On Wed, Sep 30, 2009 at 05:57:39PM +0200, Itay Donenhirsch wrote: > here's an idea - change the "callee" script to a bash script which > sources the config file, and then call the real perl script. something > along: > > #!/bin/bash > source config.env > ./script.pl $*
1. bashism: you meant: #!/bin/sh . config.env ./script.pl $* 2. What about parameters with spaces? s/$*/"$@"/ 3. Save some extra space on the the PID table: exec ./script.pl 3. You still need to export the variables to make them available in the environment of the shell script: export $EXPORTED_VARS So, something along the lines of: #!/bin/sh # Allow overriding the list in the config: is this a feature or a bug? EXPORTED_VARS="foo bar baz" . config.env export $EXPORTED_VARS exec ./script.pl "$@" -- Tzafrir Cohen | [email protected] | VIM is http://tzafrir.org.il | | a Mutt's [email protected] | | best ICQ# 16849754 | | friend _______________________________________________ Linux-il mailing list [email protected] http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
