Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2008
    Posts
    16

    Unanswered: unix shell script

    i have a folder which has some text files
    i need to write a shell script which takes this folder has input and in the out put it should give
    me the filenames,lastmodified date,and the lastline in each particular file
    help me asap
    "TALK SENSE TO FOOL. HE CALLS U FOOLISH"

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Thumbs down Homework?

    ?
    And you are asking us to do your homework?

    Try coding the script yourself and we could help you out if you get stuck.

    .
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  3. #3
    Join Date
    Sep 2008
    Posts
    16

    no guys here the code

    # !/bin/bash
    echo -n "Enter Your Folder With Full Path : "
    read path
    cd $path
    ls -c -lt | more
    tail -1 *.*
    now can u tell me whether the code works as desired or not
    "TALK SENSE TO FOOL. HE CALLS U FOOLISH"

  4. #4
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    I can't imagine a case where you might want to do somethig like this
    But this is how
    find . -type f -ls -exec tail -1 {} \;

  5. #5
    Join Date
    Sep 2008
    Posts
    16

    Thumbs up check this out

    hey ur is running into a infinte loop
    i think the follow is good if any errors plz correct
    ls -c -lt | tail -1 *.* |more
    "TALK SENSE TO FOOL. HE CALLS U FOOLISH"

  6. #6
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713
    You can omit the '*.*' part.
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Posting Permissions

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