$values contains a string which I grep from a config file. This string can be eiter: ?, ! or just a string containing words like "foo bar".
values="?"
for value in ${values}
do
echo "value is ${value}"
done
If I execute the script on local host, the result is:
value is ?
However, if i execute the script from a remote host (using ssh and sudo su - someuser "/tmp/foo.sh"), the result is:
value is 2
Until now, I was not able to find out whats different. Could anyone help please?
2in your remote machine? Note thatls ?returns2if you happen to have a file with that name, or -in general- it returns the list of files with one character name.