> THAT will work. But why are you writing a script to read a shell command > and then execute it? There is already a program that reads shell commands
This capability will be useful for debugging bash script. For example, I have a set of commands in a bash script, each of them output some thing to stdout. However, I can not tell the start and end of each output. I could have a command that does what I expect execute.sh to do. cmd1 cmd2 ... I can easily append each command with 'execute.sh', which will not only tell me the boundary of each output but also help me remember what command was executed. execute.sh cmd1 execute.sh cmd2 ... Since what I expect is not possible, the next solution is to use the eval version which requires to put quote around cmd1, cmd2... But this is very annoying, when cmd1, cmd2 themselves have the quotation marks, I have to escape these marks. So neither solution to execute.sh is ideal, although any of them is better than the other in certain situations. -- Regards, Peng