Problem to execute a shell command with run()
Hello,
The concerned command is a bit particular as it's defined like below where I pipe answers to a script:
sh -c 'cd /home/my/path && printf "1\ny\ny\
This command perfectly works in bash but I want to execute it from Sikulix script (jython).
My code is:
cmd = "sh -c 'cd /home/my/path; printf \"1\ny\
print cmd
print run(cmd)
The output in Sikulix IDE's console is:
sh -c 'cd /home/my/path; printf "1
y
y
y
y
y
" | ./scripts/
1
*****error*****
/home/my/path;: -c: line 0: unexpected EOF while looking for matching `''
/home/my/path;: -c: line 1: syntax error: unexpected end of file
I don't really understand the error and who complains about the bad syntax.
Regards,
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Alain Bonnefoy
- Solved:
- Last query:
- Last reply: