Chapter 2 Challenges

From Linux Shell Scripting Tutorial - A Beginner's handbook
Jump to: navigation, search
← Debug a scriptHomeChapter 3:The Shell Variables and Environment →
  • Write the following shell script, and note the output:
# Script to print currently logged in users information, and current date & time.
clear
echo "Hello $USER"
echo -e "Today is \c ";date
echo -e "Number of user login : \c" ; who | wc -l
echo "Calendar"
cal
exit 0
  • Write a program that prints your favorite movie name. It should print director name on the next line.
  • Write a shell script that prints out your name and waits for the user to press the [Enter] key before the script ends.
  • List 10 builtin and external commands.
  • cd to /etc/init.d and view various system init scripts.
  • Chapter 2 answers
← Debug a scriptHomeChapter 3:The Shell Variables and Environment →