Unix Blog

 
 
 
check=\`date +%H\`
echo $check
if [ $check -ge 06 -a $check -le 12 ]
then
        echo \"Good morning\"
elif [ $check -ge 12 -a $check -le 17 ]
then
        echo \"Good afternoon\"
else
        echo \"Good evening\"
fi

    Related Post:
  1. Shell script which whenever gets executed displays the message “Good Morning/Good afternoon /Good Evening “depending on the time it get executed

  2. Write a shell program to search for a given number from the list of numbers provided using binary search method

  3. Write a shell program to count number of words, characters, white spaces and special symbols in a given text

  4. Shell Script to find out the sum of the given numbers using command line argument

  5. Script to count and report the number of entries present in each subdirectory mentioned in the path, which is supplied as a command-line argument

  6. Write a shell script to display the digits which are in odd position in a given 5 digit number

  7. How would you display the calendar of 2007?

  8. Write a shell program to add, subtract and multiply the 2 given numbers passed as command line arguments

  9. Write a shell script, which displays a list of all files in the current directory to which you have read, write and execute permissions

  10. Display file in column format

  11. Shell Script to read data from a file

  12. To identify directory and executable file which command is used?

  13. Write a shell program to convert all the contents into the uppercase in a particular file

  14. How would u get today\’s date?

  15. Write a menu driven shell script for Copy a file, Remove a file, Move a file

  16. Write a shell script, which will receive any number of filenames as arguments .The shell script should check whether such files already exist.

  17. Find all lines in a file with words longer than 4 characters, assuming that words are separated by spaces except at the beginning or end of line

  18. Display your login name

  19. Write a shell script to find the sum, the average and the product of the four integers entered

  20. Write a shell program to count the characters, count the lines and the words in a particular file