Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!hplabs!nsc!amdahl!suresh From: suresh@uts.amdahl.com (Suresh Padmanabhan) Newsgroups: comp.unix.questions Subject: Re: Using awk with rsh Keywords: awk, rsh Message-ID: <65vJ01pA90Nn00@amdahl.uts.amdahl.com> Date: 21 Jun 91 20:17:09 GMT References: <9105241726.AA16913@?lri.uwo.ca> <49494@ut-emx.uucp> <1991Jun19.143911.22217@rodan.acs.syr.edu> Organization: Amdahl Corporation, Sunnyvale CA Lines: 30 In article <1991Jun19.143911.22217@rodan.acs.syr.edu>, mitanu@goedel.top.cis.syr.edu (Mitanu Paul) writes: > > I have tried to use awk with rsh, > rsh spica "ps -l | awk '{ print $4}'" > and here is what I get: > > F UID PID PPID CP PRI NI SZ RSS WCHAN STAT TT TIME COMMAND > 20488200 109 2548 2547 1 15 0 96 0 kernelma IW pc 0:00 -csh (csh) > 20008000 109 2599 2548 0 1 0 292 0 select IW pc 0:05 emacs p2.pl > > Question: > Is this a bug of awk or that of rsh? Is there something which I am missing? You ARE missing something. The trick is to hide the metacharacters from the shell at the server end . Try the following syntax : remsh spica "ps -ef| awk '{print \$4}'" Hope this helps. ***************************************************************************** Suresh Padmanabhan (suresh@uts.amdahl.com) Amdahl Corp. Phone:(408)737-5738 ***************************************************************************** -- ***************************************************************************** Suresh Padmanabhan (suresh@uts.amdahl.com) Amdahl Corp. Phone:(408)737-5738 *****************************************************************************