Thread: Unix Directory

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    Stamford, CT
    Posts
    5
    Rep Power
    0

    Unix Directory


    Hi,

    Unix -Hp
    In my Korn Shell script my argument is : /HomeDirectory/reports/filename.ps

    How can I extract from this argument only the directory without filename and extension ?


    Thanks,
    Last edited by faubertr; June 3rd, 2003 at 07:25 AM.
  2. #2
  3. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Yerevan, Armenia
    Posts
    224
    Rep Power
    12
    A bit more specific please. What language are you using?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    52
    Rep Power
    12
    Read the man page for basename(1).
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    Stamford, CT
    Posts
    5
    Rep Power
    0

    Lightbulb Unix -Hp Directory.


    Thanks for the help and the answer is :

    NAME=$(dirname /home/faubertr/reports/text.ps)

    faubertr:/home/faubertr>echo $NAME
    /home/faubertr/reports


    not exactly what's showing in examples from the man page.

IMN logo majestic logo threadwatch logo seochat tools logo