Write shell script for the following
It should display menu for following
Display file contents with line number
display the file contents with page break
echo "\n Enter your choice \n1)show file content with line number 2) show file content with pagebreak\n 3)quit" read choice case "$choice" in 1)echo "enter the file name";read fname;cat -b $fname;; 2)echo "enter the file name";read fname;cat $fname | more;; 3)exit esac
Write a shell script for accepting the following information and storing in file.
i) customer name
ii) item description
iv) rate the user should get the facility to enter as many record as he wants.
ans=y echo "enter the file name:\c" read fname while [ "$ans" = "y" ] do echo "Enter\n customer name |item description| quantity| rate:\c" >/dev/tty read cname itemd quant rate echo "$cname|$itemd|$quant|rate" >> $fname echo "record inserted successfully:\c" echo "do you want to continue:(y/n)" read c case "$c" in y*|Y*) ans=y;; n*|N*) ans=n;; *) ans=y ;; esac done