DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Shell Programming help

  1. #1
    Join Date
    Mar 2001
    Posts
    287

    Shell Programming help

    Korn Shell
    I have a line like this:

    LINE='/dev/vx/dsk/sapmnt 14487552 2584835 11172528 19% /sapmnt'

    $ echo $LINE | awk '{print $5}'
    19%

    Question: How do I get the number "19" only? How do I get rid of the "%" sign?

  2. #2
    Join Date
    May 2002
    Posts
    2,645
    $ echo $LINE | awk '{print $5}'| cut -c1,2

  3. #3
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    echo $LINE | awk '{print $5}' | awk -F% '{print $1}'
    Jeff Hunter

  4. #4
    Join Date
    May 2002
    Posts
    2,645
    $ echo $LINE | awk '{print $5}' | tr -d %

  5. #5
    Join Date
    Mar 2001
    Posts
    287
    Thank you!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width