Help with a script

Discussion in 'Command Line' started by caldwelld, Nov 18, 2012.

  1. caldwelld

    caldwelld New Member

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hello everyone. I am a newbie to script writing and have been asked to create a script that "asks the user for a file and then appends the date to the file that the user has entered". I have researched so much on this I have overloaded myself. Any help would be greatly appreciated. The part that stumps me the most is where I need to append the date to whatever file they enter.

  2. old_bolvan

    old_bolvan New Member

    Messages:
    15
    Likes Received:
    3
    Trophy Points:
    3
    Code:
    #!/bin/sh
    read -p "Enter filename: " FILENAME
    echo `date` >>"$FILENAME"
    caldwelld likes this.

Share This Page