Try enclosing the entire value specified for the COMMAND option value in 
double quotes.  This means that you have to escape any double quotes 
within the double quotes with a backslash (e.g. \").  For example:

STAF 172.16.60.111 PROCESS START SHELL COMMAND "dbtool.py -t jobs -a 
rawquery -q \"update run_jobs set 
jobcomments=CONCAT(jobcomments,'\r\n','hi') where jobid='job000002'\""

Also, note that It can also depend on the shell from which you are 
submitting a command (not just a STAF command) how the shell does parsing 
of single and double quotes.  Using double quotes around the option value 
when submitting a STAF service request via the command line is generally 
safer than using the single quotes for a lot of shells, especially on 
Unix.

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




From:   babmis <bab...@outlook.com>
To:     staf-users@lists.sourceforge.net, 
Date:   12/05/2013 07:24 AM
Subject:        [staf-users] Fwd: Command parsing failed with staf for 
multiple " (    \n







Hi ,
I have a command

dbtool.py -t jobs  -a rawquery -q "update run_jobs set
jobcomments=CONCAT(jobcomments,'\r\n','hi') where jobid='job000002' "


This works perfectly on localhost when i am trying to do the same with
staf from remote machine as below it fails :

  staf  172.16.60.111 PROCESS START SHELL COMMAND  'dbtool.py -t jobs -a
rawquery -q "update run_jobs set
jobcomments=CONCAT(jobcomments,'\r\n','hi') where jobid='job000002' "'


How should i pass \r and \n and how to avoid interpolating in  staf 
commands when executed remotely




------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk

_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users


------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to