G
Gerad S.
Hi All,
I am trying to add functionality to an interesting script. The part
that is tripping me up is that I have to make a system call to echo, and
feed several parameters. One of the parameters occasionally includes
the ` character.
Because of this, the syntax of:
`echo "#{someVar}" | ./some-script.py > "#{outputFile}"`
is breaking when #{someVar} contains the tick `. This causes the
command to fail because it executes up to the tick ` in someVar and not
to the end as intended.
I have also tried using the system() command as follows:
system("echo \"#{someVar}\" | ./some-script.py > \"#{outputFile}\"")
But this fails when there is a tick ` in #{someVar} as well.
Any help would be appreciated.
Thanks,
Gerad
I am trying to add functionality to an interesting script. The part
that is tripping me up is that I have to make a system call to echo, and
feed several parameters. One of the parameters occasionally includes
the ` character.
Because of this, the syntax of:
`echo "#{someVar}" | ./some-script.py > "#{outputFile}"`
is breaking when #{someVar} contains the tick `. This causes the
command to fail because it executes up to the tick ` in someVar and not
to the end as intended.
I have also tried using the system() command as follows:
system("echo \"#{someVar}\" | ./some-script.py > \"#{outputFile}\"")
But this fails when there is a tick ` in #{someVar} as well.
Any help would be appreciated.
Thanks,
Gerad