Académique Documents
Professionnel Documents
Culture Documents
Write a shell program to find the average of students marks using for loop and while
loop.
#!/bin/zsh
sum=0
min=10000
max=0
n=5
i=0
file="students.txt"
Write a shell script that accepts a file name starting and line number as arguments and
display all line.
#!/bin/csh
head -$argv[3] $argv[1] | tail -n $argv[2]
Write a shell script that accept two integers as its argument and computes the value of
first number raised to the power of the second number.
#!/bin/csh
set c = 1
set result = 1
while($c <= $argv[2])
@ result *= $argv[1]
@ c = $c + 1
end
echo "$argv[1] raised to the power of $argv[2]=$result"