Commit efe0b6c4 authored by Bandana's avatar Bandana

he

parents
#!/bin/bash
read var
s=0
while [ $var -gt 0 ]
do
k=$(( $var * $var ))
var=$(( $var - 1 ))
s=$(( $s + $k ))
done
echo $s
#! /bin/bash
file="$1"
ls -F "$file"|grep /|wc -l
#!/bin/bash
grep "5" q3_in.txt > q3_out.txt
sort -n -o q3_out.txt q3_out.txt
This diff is collapsed.
This diff is collapsed.
#!/bin/bash
SUM=0
n=0
while read LINE
do
SUM=`expr $SUM + $LINE`
((n=n+1))
done < q4_in.txt
echo $SUM
echo $n
echo "scale=2;$SUM/$n"|bc
Bandana Raviteja(203050084)
Question:2
Reference:
https://www.tecmint.com/wc-command-examples/
https://unix.stackexchange.com/questions/1645/is-there-any-option-with-ls-command-that-i-see-only-the-directories#:~:text=If%20you%20want%20to%20see,argument%20(%20ls%20%2DCFR%20).
Abhishek Chugh(203050046)
Question 1 &3
Reference:
https://stackoverflow.com/questions/43554862/how-to-calculate-median-for-each-row-from-file-in-bash-shell-script
Navneet Ranjan(203050106)
Question:4
Reference:
Stackoverflow
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment