1
I have the following Sun Grid Engine submission script:
#!/bin/sh
# sun grid engine cluster
# use current working directory
#$ -cwd
# merge error output into standard output stream
#$ -j yes
#$ -o generate_databases.log
# request to cpu number
#$ -pe make 4
currentdir=`/bin/pwd`
echo "current working directory: $currentdir"
And here is my output
/home/eamorr/sge
currentdir: Undefined variable.
As you can see, the 'currentdir' variable returns undefined.
How to fix this?
Your sure that
/bin/pwd
is correct? Does it work when invoked manually? – Bobby – 2012-09-19T12:39:35.207The fact that the script output the current directory (
/home/eamorr/sge
) suggests that it is findingpwd
. And, even if not, it shouldn't cause this error;foo=\
/no/such/command`` should still either assign a null string tofoo
or abort the script. – Scott – 2012-09-19T20:39:27.077