Question for Unix Gurus

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TheJimmy
    ICQ- five seven 0 2 5 5 0
    • Jan 2001
    • 10747

    #1

    Question for Unix Gurus

    I'm sure there is a way to do this with a *nix command but I'm at a complete loss...


    I have a group of data...like the following


    domain.com/subdir/yadayada.php?sqiggly,;lkjsdf;lkajsdf
    domain.com/subdir/stuff.php
    domain.com/lalbasdf.php12341234

    etc


    is there a way to chop off the trailing items just leaving

    the

    domain.com/subdirs

    and

    domain.com



    ?



    thanks in advance...
    Investor with 5m - 15m USD to invest. Do you have a site or network of sites earning 50k - 200k a month income? Email your contact and preliminary data to: domain.cashventures (at) gmail.com....Please...no tire kickers...serious offers and inquiries only.
  • Eve
    Confirmed User
    • Dec 2002
    • 805

    #2
    http://www.cs.uu.nl/docs/vakken/st/nawk/nawk_toc.html
    I'm waiting for the Mr Fushion Fleshlight so I can wank my way back to the future!

    Comment

    • vending_machine
      Confirmed User
      • Jun 2002
      • 1070

      #3
      Is this what you're trying to do (done in bash)?

      Code:
      # cat list
      domain.com/subdir/yadayada.php?sqiggly,;lkjsdf;lkajsdf
      # cat list | while read line ; do dirname $line ; done
      domain.com/subdir

      Comment

      Working...