Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Location
    Gdańsk
    Posts
    2

    Unanswered: Extracting a file date

    Hello

    I'm in need of a shell script that would extract a date of a file preferrably in YYYY-MM-DD format.

    Wouldn't want to use ls, as it returns rather not shell friendly format.

    Perl would be ok, but really would love it done in plain shell. Anybody with anything already completed?

    Thanks in advance.

  2. #2
    Join Date
    Mar 2003
    Posts
    280
    Couldnt you use the --timestyle flag for ls? I.e.

    ls -l --time-style="+%Y-%m-%d-%H:%M:%S"

    HTH
    /Lennart

  3. #3
    Join Date
    Jan 2004
    Location
    Gdańsk
    Posts
    2
    Originally posted by lelle12
    Couldnt you use the --timestyle flag for ls? I.e.

    ls -l --time-style="+%Y-%m-%d-%H:%M:%S"

    HTH
    /Lennart
    Thanks for help, but that doesn't work.

    It's a HP-UX 11i and ls doesn't support that option
    And I can't install other ls version

    Still need 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
  •