Explore BrainMass

Explore BrainMass

    unix shell script to check date and give message

    Not what you're looking for? Search our solutions OR ask your own Custom question.

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Create a script that checks the day of the week, and takes one of two actions (step 2 or 3) depending on the day.
    If the day is Monday through Friday, print (send to stdout) the name of the day. Then, find each file named TTDL (Things-To-Do List) in the tree rooted at the current directory (pwd on down). Using a separate output line for each of these files, print the file path and the number of lines in the file using wc -l. Create at least two TTDL files to test my program: one in my working directory and one in a subdirectory.
    If the day is Saturday or Sunday, print only a simple message, such as "Go back to sleep".
    Run my script on a weekday, redirecting your output to the file my_save and append a copy of my script.

    © BrainMass Inc. brainmass.com March 4, 2021, 9:30 pm ad1c9bdddf
    https://brainmass.com/computer-science/trees/unix-shell-script-to-check-date-and-give-message-249994

    Solution Preview

    Attached are the following:
    1. 249994.sh : This is the script file containing the commands and explanations.
    2. my_save : This is the output file
    3. TTDL : ...

    Solution Summary

    Attached are the following:
    1. 249994.sh : This is the script file containing the commands and explanations.
    2. my_save : This is the output file
    3. TTDL : This is the input file I created

    $2.49

    ADVERTISEMENT