Re: Get/find-question in script

From: Bill Thompson (bill.thompson_at_GOODYEAR.COM)
Date: 12/29/03

  • Next message: Abdellah Djebli: "Re: question about CPU Wait%"
    Date:         Mon, 29 Dec 2003 15:21:52 -0500
    To: aix-l@Princeton.EDU
    
    

    lscfg -vl rmt1 | grep Serial | awk -F. '{print $NF}'

    will give you just the serial number with the leading zeros.

    To get rid of the leading zeros you could try something like this:

    lscfg -vl rmt1 | grep Serial | awk -F. '{print $NF}' | sed -e 's/^00*//'

    Bill Thompson
    Sr UNIX Systems Administrator
    The Goodyear Tire & Rubber Co.

    Contains Confidential and/or Proprietary Information
    May Not Be Copied or Disseminated Without Express Consent of The Goodyear
    Tire & Rubber Company.

    AIX-L Archives: http://marc.theaimsgroup.com/?l=aix-l&r=1&w=2

    ----- Original Message -----
    From: "brian welsh" <brianwelsh3@HOTMAIL.COM>
    Newsgroups: bit.listserv.aix-l
    To: <aix-l@Princeton.EDU>
    Sent: Monday, December 29, 2003 2:29 PM
    Subject: Get/find-question in script

    > Hello,
    >
    > If I give the next command, I receive the following output:
    >
    > $ lscfg -vl rmt1
    > rmt1 U0.1-P2-I2/Q1-W3000000089756EC4-L1100000000000 IBM
    3590
    > Tape Drive and Medium Changer (FCP)
    >
    > Manufacturer................IBM
    > Machine Type and Model......03590H1A
    > Serial Number...............000000097418
    > Device Specific.(FW)........F29C
    > Loadable Microcode Level....A0B00E26
    >
    > If I run the following command, I receive the following output:
    > $ lscfg -vl rmt1 | grep Serial
    > Serial Number...............000000057149
    >
    > Now I only need the Serial Number, the digits, not the text 'Serial
    Number'
    > and the dots, so only 000000097418
    >
    > If I run the following command, I receive the following output:
    > $ lscfg -vl rmt1 | grep Serial | awk '{print $2}'
    > Number...............000000057149
    >
    > Can anyone give me a hint which command to use if I only want to have:
    > 000000097418
    > or
    > 97418
    >
    > Thanx in advance...
    >
    > Brian
    >
    > _________________________________________________________________
    > MSN Zoeken helpt je om de gekste dingen te vinden! http://search.msn.nl


  • Next message: Abdellah Djebli: "Re: question about CPU Wait%"

    Relevant Pages

    • Re: find command tweak
      ... The Goodyear Tire & Rubber Co. ... Tire & Rubber Company. ... Subject: find command tweak ... > of course using the proper form of the compress command ...
      (AIX-L)
    • PgSp and Paging Space
      ... I have an admin here who is trying to run a fairly simple command on AIX, ... I had him run the command while I monitored the system with "topas". ... Goodyear Tire and Rubber Company ... written consent of The Goodyear Tire & Rubber Company. ...
      (AIX-L)
    • Re: The Find command for hours
      ... I also know that I could use the touch command ... Goodyear Tire and Rubber Company ... written consent of The Goodyear Tire & Rubber Company. ...
      (AIX-L)
    • Re: update_flash: Command not supported
      ... After doing that, the update_flash command worked. ... Technical Support Analyst - Sr. ... May Not Be Copied or Disseminated Without Express Consent of The Goodyear Tire & Rubber Company. ...
      (AIX-L)
    • Re: zero out unused HD space
      ... > Using this command ... All this means that what used to be unused disk space has now ... been taken by the file "filler", which happens to be full of zeros. ...
      (freebsd-questions)