Re: Get/find-question in script

From: Bill Thompson (bill.thompson@GOODYEAR.COM)
Date: Mon Dec 29 2003 - 15:21:52 EST


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



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:25 EDT