execute a command

Posted by lakshmipathi on Stack Overflow See other posts from Stack Overflow or by lakshmipathi
Published on 2010-04-06T11:47:32Z Indexed on 2010/04/06 11:53 UTC
Read the original article Hit count: 349

Filed under:
|

I have script file where a command is stored in a variable

First i got the command (assume "ls -l " command)

cmd= cat /proc/2345/cmdline

now doing

echo $cmd

outputs

ls -l

Now how to use $cmd to actually execute that command. which is ls -l

© Stack Overflow or respective owner

Related posts about linux

Related posts about shell