I generate a fullpath variable two different ways:
1) concat two variables rootpath and relpath to give me fullpath
2) use 'find' to get the fullpath
when I echo the variable, I get the same output for both. However,
I print the variable from method 1 in the below loop I get "awk syntax error near line 1" The second method works fine
while read line
do
if test $i -ge 1;
then
echo "$line" | awk -F'|' '{print "cd" " '$fullpath'/" }' >> RemoveFiles.sh
echo "$line" | awk -F'|' '{print "rm \""$1 "\"" }' >> RemoveFiles.sh
fi
i=$i+1
done < $input
contents of fullpath:
/supmm/su/gsa44/svr/locs/workloc
From echo there are no differences between the two variables
Can anyone explain why method 1 does not work but method 2 does?
thanks,