Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

USING AWK

Status
Not open for further replies.

johngiggs

Technical User
Oct 30, 2002
492
US
I have the following awk script which is not working.

# ------ fs.awk ------

BEGIN {OFS = "\t";print "Filesystem Capacity";print "=================
==============="}
/"^/"/{a = $1}
/^[0-9]* %/{print a, "\t\t"$1" %"}

How do I change the line:

/"^/"/{a = $1}

So that if the first character is a / then it prints the first field? I tried using " and ', but I can't figure it out.

Thanks,

John

 
Try

/^\//{a = $1}


CaKiwi

"I love mankind, it's people I can't stand" - Linus Van Pelt
 
Thanks, Cakiwi. I figured I had to backslash escape it, but I wasn't sure...

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top