Example:
touch functiontest.sh
pico functiontest.sh
#!/bin/bash
# Date:
# Author:
# Purpose:
# Created:
# Modified:
function showdate()
{
date +%F
}
function showtime()
{
date +%r
}
function getuserinfo()
{
clear
echo Please enter your firstname and last name
read firstname lastname
echo Hello $fisrtname $lastname
}
function mailadmin()
{
echo success | mail -s "Success Executions of script" root
}
showtime
showdate
getuserinfo
#mailadmin
# END
source ./functiontest.sh
No comments:
Post a Comment