On Fri, Apr 2, 2010 at 12:07 PM, Fred James <[email protected]>wrote:
> Denis Heidtmann wrote: > > I have a very simple bash script which wants an argument. I would like > to > > source it. I find that if I source it from another script using its > > relative path it works fine--the argument is received. If I source it > using > > its full path no argument is received. A simple test is: > > > > script1.sh: > > #! /bin/sh > > echo "Argument = $@" > > > > script2.sh: > > #!/bin/sh > > . <full path>/script1.sh full > > . <relative path>/script1.sh relative > > > > The result show no argument received in the full case. > > > > Ideas? > > > Denis Heidtmann > If you are trying to send an argument from script2 to script1 then you > should not need to use the dot (.) - the modifications below should do > the trick ... or did I miss something? > Regards > Fred James > > cript1.sh: > #! /bin/sh > echo "Argument = $1" > > script2.sh: > #!/bin/sh > <full path>/script1.sh full > <relative path>/script1.sh relative > > I want to run the script from /etc/gdm/PostSession/Default. The Debian Policy says additions to Default should be sourced. Hence, the dot. If I just execute my script, it works fine. -Denis _______________________________________________ PLUG mailing list [email protected] http://lists.pdxlinux.org/mailman/listinfo/plug
