[HPADM] RE: weird remsh/awk behavior

From: Paveza, Gary (gary.paveza_at_AIG.COM)
Date: 11/05/03

  • Next message: Paveza, Gary: "[HPADM] SUMMARY: weird remsh/awk behavior"
    To: "'HP9000 Admin'" <hpux-admin@dutchworks.nl>
    Date: Wed, 5 Nov 2003 10:20:59 -0500 
    
    

    A couple of mentioned that I can remove the "" around the command that remsh
    is executing. That works, however, the awk is actually being done on the
    local machine then. This would be fine, except that what I'm really trying
    to do is kill some processes on a remote system:

    remsh <remote> "ps -fu <user> | grep <program> | grep -v grep | awk '{print
    $2}' | xargs kill -15"

    So, the entire command has to be on the remote system.
    ---------------------------------------------------------
    Gary Paveza, Jr.
    Senior Systems Administrator -CSA
    (302) 252-4831 - phone
    (302) 377-1516 - cell

            -----Original Message-----
            From: Paveza, Gary [SMTP:gary.paveza@AIG.COM]
            Sent: Wednesday, November 05, 2003 9:57 AM
            To: 'HP9000 Admin'
            Subject: [HPADM] weird remsh/awk behavior

            Has anyone noticed the following remsh/awk behavior and if so, a
    workaround?

            Issuing who on the local machine works as expected.

            $ who
            dmullins pts/ta Nov 2 13:10
            npathil pts/tb Nov 3 16:30
            cdigrego pts/tc Nov 5 05:18

            Issuing who on the local machine and using awk to print out just the
    user
            name works as expected.

            $ who | awk '{print $1}'
            dmullins
            npathil
            cdigrego

            Using remsh to issue who on a remote machine works as expected.

            $ remsh dhapp01 "who"
            plpcd5 pts/ta Nov 5 09:21
            gpaveza pts/tc Nov 5 09:27

            Using remsh to issue a who on a remote machine and using awk to
    print out
            just the user name fails to work.
             
            $ remsh dhapp01 "who | awk '{print $1}'"
            sh: 1: Parameter not set.

            ---------------------------------------------------------
            Gary Paveza, Jr.
            Senior Systems Administrator -CSA
            (302) 252-4831 - phone
            (302) 377-1516 - cell

            --
                         ---> Please post QUESTIONS and SUMMARIES only!! <---
                    To subscribe/unsubscribe to this list, contact
    majordomo@dutchworks.nl
                   Name: hpux-admin@dutchworks.nl Owner:
    owner-hpux-admin@dutchworks.nl
             
             Archives: ftp.dutchworks.nl:/pub/digests/hpux-admin (FTP,
    browse only)
                        http://www.dutchworks.nl/htbin/hpsysadmin (Web, browse
    & search)

    --
                 ---> Please post QUESTIONS and SUMMARIES only!! <---
            To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
           Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
     
     Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
                http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)
    

  • Next message: Paveza, Gary: "[HPADM] SUMMARY: weird remsh/awk behavior"

    Relevant Pages

    • Re: Removing lines from a plain text file
      ... Apparently there is no simple command. ... > and put prune in a cron job. ... > size by removing the excess from the beginning of the file. ... date from the past and use awk to search through the file for it and discard ...
      (comp.unix.sco.misc)
    • Re: win xp firewall
      ... actually I was talking about the net send command which is used to> send a popup box to a remote system running the messenger service.. ... you can't> infect / install or otherwise tamper with a remote system via the net send> command "net> send /?" ...
      (comp.security.firewalls)
    • Re: win xp firewall
      ... send a popup box to a remote system running the messenger service.. ... infect / install or otherwise tamper with a remote system via the net send ... command "net ... Public Enemy #7 "God told me to skin you alive" ...
      (comp.security.firewalls)
    • Re: Closing a field
      ... I thought of the same solution, that of using the field number count as the discriminant, mainly because I don't have any idea how to use AWK to validate a field as a number. ... The treatment of tabs as an alias for spaces in some POSIX is motivating me to stay away from them. ... already have a filter called 'join' so why not use AWK to create a filter called 'select' and for other SQL commands as well. ... I'd want to call the script by its SQL command name and use it as an SQL-like Unix pipe filter. ...
      (comp.lang.awk)
    • Re: Problem while executing "system " in awk
      ... There is a file(named myno) containg phone numbers. ... I've written following awk prog ... Please suggest why my systemcommand is not executing ... it is possible that the shell is seeing your command as ...
      (comp.lang.awk)