Shell Script to display current date, calendar, and the number of user logged

in Categories Academic last updated April 3, 2008

This script use the concept of command substitution. It allows allows the output of a command to replace the command name. There are two forms:




Bash shell performs the expansion by executing command and replacing the command substitution with the standard output of the command, with any trailing newlines deleted. Embedded newlines are not deleted, but they may be removed during word splitting.

For example you can execute date command to display todays date and then set a variable called NOW:
To display back variable value simply run echo command:
echo $NOW

Sample Shell Script

Share this on: