The 10.Delete data doesnt work at all, plesase anyone could help on that. When I choose options 10 to delete a record it only copy the selected data on the other file dbs1 but doesnt delete it from the database where other records are.
#! /bin/bash
i="y"
echo "Enter name of database "
read db
while [ $i = "y" ]
do
clear
echo "1.Enter id "
echo "2.Display current dir"
echo "3.Listing the dir"
echo "4.Make a dir"
echo "5.Copy a file"
echo "6.Rename file"
echo "7.Delete file"
echo "8.Edit file"
echo "9.Add e record"
echo "10.Delete data"
echo "11.Exit"
echo "Enter your choice"
read ch
case $ch in
1)echo "Enter id "
read id
grep -i "$id" $db ;;
2)echo "Current Dir is : "
pwd;;
3)echo "Directories are"
ls;;
4)echo "Enter dir name to create"
read d
mkdir $d
echo $d" Dir is created";;
5)echo "Enter filename from copy"
read f1
echo "Enter filenm2 to be copied"
read f2
#cat $f1 > $f2
cp $f1 $f2
echo $f2" is copied from "$f1;;
6)echo "Enter file name to rename"
read f1
echo "Enter new name of file"
read f2
mv $f1 $f2
echo $f1" is renamed as "$f2;;
7)echo "Enter any filenm to be delete"
read f1
rm $f1
echo $f1" is deleted";;
8)echo "Enter any file to be editing "
read f1
vi $f1;;
9)echo "Enter the name"
read kdi
echo �$kdi� > dbkodi
cat dbkodi
echo "Enter the profesion:"
read tpi
echo �$tpi� > dbtitulli
cat dbtitulli
echo "Enter the school "
read ept
echo �$ept� > dbemri_piktorit
cat dbemri_piktorit
echo "Enter the class"
read cmm
echo �$cmm� >dbcmimi
cat dbcmimi
echo "$kdi $tpi $ept $cmm">>$db;;
10)echo "Enter Id"
read id
# set -a
sed '/$id/d' $db > dbs1
grep -v "$id" $db > dbs1
echo "Record is deleted"
cat dbs1;;
11)echo "Have a nice time"
exit;;
*)echo "Invalid choice entered";;
esac
echo "Do u want to continue ? "
read i
if [ $i != "y" ]
then
exit
fi
done