Why does plink have an issue with brackets?

时间:2016-08-18 19:09:51

标签: shell ksh plink

I'm trying to use plink to run a pl/sql package on a remote service running the ksh shell. I can connect and everything is fine but I cannot pass a ( bracket to plink without ksh throwing up an error.

When I type this from a dos command prompt:

plink myuser@server -pw password echo "This is a test"

everything works fine. But when I type

plink myuser@server -pw password echo "This is a test ( )"

I get:-

 ksh: 0403-057 Syntax error at line 1 : `(' is not expected.

I have the same problem when calling packages. If the package has a ( then it fails when called through plink but runs fine when entered directly into a putty window.

Does anyone know why plink/ksh has a problem with brackets?

1 个答案:

答案 0 :(得分:0)

解决方案是用' \'来避开括号。即

plink myuser@server -pw password echo "This is a test \( \)" 

http://www.ibm.com/support/knowledgecenter/ssw_aix_72/com.ibm.aix.osdevice/korn_shell_quote_chars.htm