[c3-users] 回复:Re: cexce question

Thomas Naughton naughtont at ornl.gov
Mon Jan 6 09:39:51 EST 2014


Great!

--tjn

  _________________________________________________________________________
   Thomas Naughton                                      naughtont at ornl.gov
   Research Associate                                   (865) 576-4184


On Sat, 4 Jan 2014, fwuwen at sina.cn wrote:

> 
> thank you 
> 
> I tried using a temporary script, it's ok
> 
> ----- 原始邮件 -----
> 发件人:Thomas Naughton <naughtont at ornl.gov>
> 收件人:"fwuwen at sina.cn" <fwuwen at sina.cn>
> 抄送人:c3-users <c3-users at elist.ornl.gov>
> 主题:Re: [c3-users] cexce question
> 日期:2014年01月03日 02点34分
> 
> Hi,
> Generally when using a pipelined command like this, you'll want to enclose
> the entire string in a single quote to avoid having the local shell expand
> pieces of the string. However, when there are problems or complicated
> shell escaping the easiest method is to just create a tmp script file and
> run that:
> # Print username for my accounts (naughton) on cluster
> tjn at node0:$ cat tmp.sh
> cat /etc/passwd | grep -i naughton | awk -F: '{print $1}'
> tjn at node0:$ cexec :1 bash ./tmp.sh
> ************************* oscar_cluster *************************
> --------- node1---------
> tjn
> naughton
> tjn at node0:$
> Note, the "}" in the awk command caused a problem for me when I just tried
> this on the cluster from command-line:
> tjn at node0:~$ cexec :1 'cat /etc/passwd | grep -i naughton | awk -F: '{print
> $1}''
> ************************* oscar_cluster *************************
> --------- node1---------
> awk: line 2: missing } near end of file
> I'd have to look more closely to see what's goofing up there, but the
> temporary script approach works so I just use that for awk's brackets.
> Hope that helps,
> --tjn
> _________________________________________________________________________
> Thomas Naughton naughtont at ornl.gov
> Research Associate (865) 576-4184
> On Thu, 2 Jan 2014, fwuwen at sina.cn wrote:
> >
> > when i execute:
> >
> >
> > cexce "ps -ef|grep java|awk '{print $2}'"
> >
> >
> > this error:
> >
> > awk: cmd. line:1: {print
> >
> > awk: cmd. line:1:       ^ unexpected newline or end of string
> >
> >
> > thank you
> >
> >
> > ps:sorry, i am poor in english
> >
> >
> >
> 
>


More information about the c3-users mailing list