CISS 105 BCCC Cat N Won2 Programming Script Writing Programming Exercise
CREATE A SCRIPT FOR THE FOLLOWING:
$ cat -n won2
1 #
2 # won2
3 # won version 2
4 # Displays the current date and time, # of users currently
5 # logged in, and your current working directory
6 #
7 date # displays current date
8 who | wc -l # displays # of users logged in
9 pwd # diplays current working directory
$_
WRITE A SCRIPT FOR THE FOLLOWING
$cat -n won3
1 #
2 # won3
3 # won version 3 – The user-friendly version
4 # Displays the current date and time, # of users currently
5 # logged in, and your current working directory
6 #
7 echo # skip a line
8 echo “Date and Time:c”
9 date # displays current date
10 echo “Number of users on the system:c”
11 who | wc -l # displays # of users logged in
12 echo “Your current directory:c”
13 pwd # displays your current directory
14 echo # skip a line
$_
CREATE A SCRIPT FOR THE FOLLOWING:
$ cat -n BOX
1 #
2 # BOX
3 # A sample program to show the shell variables
4 #
5 echo # skip a line
6 echo “The following is output of the $0 script: ”
7 echo “Total number of command line arguments: $#”
8 echo “The first parameter is: $1 ”
9 echo “The second parameter is: $2”
10 echo “This is the list of all is parameters: $* ”
11 echo # skip a line
$_