Find the answer to your Linux question:
Results 1 to 3 of 3
server 12:10 uid:gid> ls -l app-validator lrwxrwxrwx 1 skedev etdit 24 Aug 24 06:52 app-validator -> app-validator-1.3.22/ server 12:10 uid:gid> ls -l app-validator | awk '{print $11}' | awk -F ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2010
    Posts
    2

    Question awk help


    server 12:10 uid:gid> ls -l app-validator
    lrwxrwxrwx 1 skedev etdit 24 Aug 24 06:52 app-validator -> app-validator-1.3.22/


    server 12:10 uid:gid> ls -l app-validator | awk '{print $11}' | awk -F 'app-validator-' '{print $2}' | awk -F '/' '{print $1}'

    1.3.22

    I want to get 1.3.22. Is there anything that is more terse and effective than the above awk statement? Please suggest.

  2. #2
    tpl
    tpl is offline
    Linux User
    Join Date
    Jan 2007
    Location
    cleveland
    Posts
    478
    welcome to the forum

    you could use "cut" twice--

    cut -d - -f5 | cut -d / -f1
    the sun is new every day (heraclitus)

  3. #3
    Just Joined!
    Join Date
    Sep 2010
    Posts
    2

    Thumbs up Thanks, it worked.

    Thanks for the reply. It works perfectly.

  4. $spacer_open
    $spacer_close

Posting Permissions

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