[HPADM] SUMMARY: weird remsh/awk behavior

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

  • Next message: bill.thompson_at_goodyear.com: "[HPADM] MQSeries processes"
    To: "'HP9000 Admin'" <hpux-admin@dutchworks.nl>
    Date: Wed, 5 Nov 2003 10:27:23 -0500 
    
    

    Thanks to Bill for pointing me in the right direction. The solution turned
    out to be very simple. Make sure that the $ in $2 is escaped.

    remsh dhapp01 "who | awk '{print \$2}'"
    ---------------------------------------------------------
    Gary Paveza, Jr.
    Senior Systems Administrator -CSA
    (302) 252-4831 - phone
    (302) 377-1516 - cell

            -----Original Message-----
            From: Paveza, Gary
            Sent: Wednesday, November 05, 2003 10:21 AM
            To: 'HP9000 Admin'
            Subject: RE: [HPADM] weird remsh/awk behavior

            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: bill.thompson_at_goodyear.com: "[HPADM] MQSeries processes"

    Relevant Pages

    • Re: Lidl Satellite reciever etc. from 28th August
      ... in the USALS menu whilst pointing at Hotbird 13E, ... to wait whilst it searched for AMOS whatever at wherever! ... Bill, just curious - have you managed to motorise your dish successfully, ...
      (uk.tech.digital-tv)
    • Re: f2s
      ... James was simply pointing out that, to us, your OP appeared twice, ... As you were Bill! ...
      (uk.tech.digital-tv)
    • Re: A poorly Bill P
      ... Then the wall ties and pointing has to be ... Greenhouse is on hold at the moment, but grand sons and my youngest son ... Get well soon, Bill. ...
      (uk.people.silversurfers)
    • Re: This stuff about a "death panel" is ridicu ... oops!
      ... the accusations idiots. ... However no one is pointing to the bill and saying "See it doesn't say ...
      (rec.sport.pro-wrestling)
    • Re: googlefight - how can it serve me?
      ... kruse@xxxxxxxxxxxxxxxxxxx Gifty! ... Shiny! ... Thanks for pointing that out Bill, I copied it directly from my web site and ...
      (alt.internet.search-engines)