Hello all,
I have a ksh script run on Solaris 10 by the root user. The section that's giving me errors is the following:
VAR=$(perl -lne '...')
if [[ "$VAR" == "" ]] ; then
print "$VAR undefined"
fi
recover_files {
print "Recovering the files..."
cd ${VAR}/files
cp -pr nfs /destination
print "Files recovered"
}
$VAR is correctly defined (I don't see the error message displayed), however, when reaching the recover_files function, I have the following errors:
....
Recovering the files...
./my_script.sh[3]: */files: not found
cp: cannot access nfs
...
On a second run of the script, no error is displayed anymore, and the nfs directory is copied to the destination.
The "cannot access" error tells me that I was trying the cp from a wrong location, but I can't really figure out the first error - can someone help?
Thank you,
Adrian