Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
General Commands
i - left of cursor
:w - save a file
Aim: to write a shell program to display the date, time, current date and user id and parent
directory
Commands:
Synopsis: logname
Description: The logname utility writes the user’s login name to standard output followed by a
new line
Description: when invoked without arguments, the date utility display the current date and
time
Description: the pwd utility writes the absolute pathname of the current working directory to
the standard output
Synopsis: who am i
Program:
usname=telnet1
echo “User Name = $usname”
Output:
Commands Used:
Synopsis: uname
Description:
Program:
Output:
SYSTEM INFORMATION
Commands:
Program:
read n
for ((i=1;i<=$n;i++))
do
for ((j=1;j<=$i;j++))
do
echo -n “*”
done
echo “”
done
Output:
Enter No.
**
***
****
*****
Ex no :5 Looping Pattern
Commands:
Output:
Enter No.
5
*
**
***
****
*****
****
***
**
*