Re: Script variable assignment issue

From: Bill Thompson (bill.thompson@GOODYEAR.COM)
Date: Mon Jul 15 2002 - 09:26:40 EDT


VALUE=$(grep loss tempfile | cut -f7 -d" " | sed -e 's/%//')

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-;&r=1&w=2

 ----- Original Message -----
 From: Drew
 Newsgroups: bit.listserv.aix-l
 To: aix-l@Princeton.EDU
 Sent: Monday, July 15, 2002 8:56 AM
 Subject: Script variable assignment issue

 Hi fello AIXers,
             I am writing a script that includes the line:

 grep loss tempfile | cut ?f7 ?d" "

 The above line returns returns a one or two digit number with a percent
 sign. Usually it returns only: 0%

 What I'm trying to do is, remove the % sign and initialize this value to a
 variable, which I can then perform
 basic functions on. Any help would be greatly appreciated.

 I was trying something like:
 VALUE=[grep loss tempfile | cut ?f7 ?d" "]

 but it isn't working. I think I need to extract the 0 from the % and then
 assign it a variable name. I'm just not sure

 Thanks all,

 Drew



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:03 EDT