Find the answer to your Linux question:
Results 1 to 3 of 3
Hello to all! I need my script to do the following output display: a20-15-04.html to do this I need to use sed to extract the directory name from the path ...
  1. #1
    Just Joined!
    Join Date
    Apr 2010
    Posts
    2

    seeking help on my script file!

    Hello to all!

    I need my script to do the following output display:

    a20-15-04.html

    to do this I need to use sed to extract the directory name from the path and combine it with date command output.

    this is the syntax that i am using

    pwd | sed -ne 's,^\(.*/\)\?\([^/]*\),\2,';date +%d-%m".html"

    this is my output that I am getting:

    uli101.a2
    15-04.htm

    any help is greatly appreciated!!

  2. #2
    Just Joined! cfajohnson's Avatar
    Join Date
    May 2007
    Location
    Toronto, Canada
    Posts
    52
    Code:
    date +"${PWD##*/}%d-%m".html

  3. #3
    Just Joined!
    Join Date
    Apr 2010
    Posts
    2
    thanks for the help!!

Posting Permissions

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