|
Accept roll number from the user at the command line.
Search it in the “student” file. If it is present, then display name,
percentage, grade and class of the student. If the roll number is
not present, then display a message “not found”. Allow the user to
enter any number of queries.
Ans: a=$#
Write a shell script which will accept three nos. from the keyboard and finds the largest of them. Ans: function
greater()
Write a shell script to copy one file to another line by line. Ans: echo “enter
the file that we need to copy”
Write a shell script which will calculate the factorial of an integer entered from the keyboard. Ans: function fact() { i=1 for((j=1;j<=$i;j++)) do i=$[ $i*$j ] done
Write a script which when executed checks out whether
it is a working day or not?
Ans: x=$1
tuesday) echo
“it’s a working day”;;
|
|
See Also Have a Linux ProblemLinux Forum - Do you have a Linux Question? Linux Books
Linux Home: Linux System Administration Hints and Tips (c) www.gotothings.com All material on this site is Copyright.
|