Bash Shell: for loop returns different values
问题 $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? 回答1: You need to