German Guillot wrote:

> I find specifing the path the script expects in the script itself
> cuts way down on problems, especialy if you later change your path
> from what it was when you wrote the script. You can usualy depend
> on /bin;/usr/sbin, but anything else depends on how the script is
> being run.


Hm. With a script such as:

 #!/bin/bash cat /home/ger/test.1 >> /home/ger/test.2

 you mean I should write:

 #!/bin/bash /bin/cat /home/ger/test.1 >> /home/ger/test.2

Or you script can start something like:

#!/bin/bash
#
PATH=/bin;/usr/bin;/home/ger/bin

Another way you can do it is to define variables for all your commands at the start of the script, and then use the variable where you would use the command.

MYCOMMAND=/home/ger/bin/command
INFILE=/home/ger/infile.txt
OUTFILE=/home/ger/outfile.txt

$MYCOMMAND  <$INFINE >$OUTFILE

 right? Well, darn it, yes! I just tried it (that very example with
 cat, which was not working either) and now it works. That was really
 mystifying me, because I reckoned cat should always work. Of course
 it does.


Mikkel --

   Do not meddle in the affairs of dragons,
for you are crunchy and taste good with ketchup.


____________________________________________________
Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com
____________________________________________________

Reply via email to