Skip to content

Instantly share code, notes, and snippets.

@shadeslayer
Created April 27, 2011 08:45
Show Gist options
  • Select an option

  • Save shadeslayer/943939 to your computer and use it in GitHub Desktop.

Select an option

Save shadeslayer/943939 to your computer and use it in GitHub Desktop.
#############################################
# Author: Rohan Garg <[email protected] #
# License: MIT ( 2011 ) #
# helloworld.sh #
#############################################
echo "Enter first number"
read a
echo "Enter second number"
read b
c = `expr $a + $b`
echo "The sum is "
echo $c
##################################################
# Output #
# #
# [student@localhost student]$ ./helloworld.sh #
# Enter first number #
# 6 #
# Enter second number #
# 6 #
# The sum is #
# 12 #
##################################################
#############################################
# Author: Rohan Garg <[email protected] #
# License: MIT ( 2011 ) #
# helloworld2.sh #
#############################################
echo "Hello $USER!!!"
echo "Today is", date
echo "Number of users logged in is/are : "
who
cal
exit 0
######################################################
# Output #
# #
# [student@localhost student]$ ./helloworld.sh #
# Hello student !!! #
# Today is : #
# Wed Apr 27 14:33:14 IST 2011 #
# Number of users logged in are : #
# student pts/0 Apr 27 13:57 (192.168.2.207) #
# student pts/3 Apr 27 14:12 (192.168.2.214) #
# student pts/4 Apr 27 14:13 (192.168.2.211) #
# student pts/5 Apr 27 14:28 (192.168.2.225) #
# student pts/2 Apr 27 14:30 (192.168.2.218) #
# student pts/1 Apr 27 14:31 (192.168.2.216) #
# student pts/6 Apr 27 14:31 (192.168.2.210) #
# April 2011 #
# Su Mo Tu We Th Fr Sa #
# 1 2 #
# 3 4 5 6 7 8 9 #
# 10 11 12 13 14 15 16 #
# 17 18 19 20 21 22 23 #
# 24 25 26 27 28 29 30 #
######################################################
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment