[Gambas-user] OT: BASH help!

Rob sourceforge-raindog2 at ...94...
Mon May 12 06:56:17 CEST 2008


On Monday 12 May 2008 00:24, Hamish Robertson wrote:
> You're a champion! thank you so much! One last question...how do I
> pipe the output into a variable(String) to be used in the control
> file? I'm guessing the perl script here will be the easiest. If I
> can get a variable that will work in my bash script I'm away! :)

The simplest way would be backticks or $() (which place the output of 
a command into a variable.)  In this case, backticks might require 
some quoting, but with $() you should be able to go,

export MYVAR=$(perl -e 'print join(", ", map { s/.deb$//; $_ } 
split("\n", `ls *.deb`)), "\n";')

and then MYVAR will contain the comma-separated list.

I think if you need any more Bash help you should probably talk to me 
in private, though when it comes to building .deb packages I'm pretty 
ignorant.

Rob




More information about the User mailing list