Reputation: 1490
I have a command which is run with the system command. Could I log what is passed to the shell?
P.S. I've got the problems with qoutes =)
Upvotes: 0
Views: 183
Reputation: 4879
You mentioned having "the problem with the quotes". I assume you mean double quotes? Modify Vapire's solution to this:
command = %Q{echo "double quoted string"} # store the command as string
puts command # print it before you execute it
system(command) # execute it in the shell
Upvotes: 1
Reputation: 4578
You can simply print the string before you're sending it to system command
command = "whoami" # store the command as string
puts command # print it before you execute it
system(command) # execute it in the shell
Upvotes: 1