Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- i=1;
- j=1;
- echo -n "Enter Database Name : "
- read emp
- while [ $i = 1 ]
- do
- echo "-----------------------------------"
- echo "1. Add Employee Record."
- echo "2. View Employe3 Record."
- echo "3. Modify Employee Record."
- echo "4. Count Total No Of Employee."
- echo "5. Employee Gros And Salary."
- echo -n "Enter Choose : "
- read ch
- case $ch in
- 1) echo -n "Emp_Name : "
- read emp_name;
- echo -n "Emp_Gender : "
- read emp_gender;
- echo -n "Emp_Desiganation : "
- read emp_desi;
- echo -n "Emp_Salary :"
- read emp_salary;
- echo "$j|$emp_name|$emp_gender|$emp_desi|$emp_salary" >> $emp;
- j=`expr $j + 1`;
- ;;
- 2) sort -n -k1 $emp;
- ;;
- 3) echo "Enter Emp_No :"
- read n;
- grep -i "$n" $emp | tee x;
- wc -c x | tee y;
- a=`cut -d " " -f 1 y`
- if [ "$a" = 0 ]
- then
- echo "Record not found"
- else
- echo -n "Emp_Name : "
- read emp_name;
- echo -n "Emp_Gender : "
- read emp_gender;
- echo -n "Emp_Desiganation : "
- read emp_desi;
- echo -n "Emp_Salary :"
- read emp_salary;
- grep -v "$n" $emp | cat > def;
- cat def | tee $emp;
- echo "$n|$emp_name|$emp_gender|$emp_desi|$emp_salary" >> $emp;
- fi
- ;;
- 4) wc -l $emp;
- ;;
- 5) echo -n "Enter No. ";
- read temp;
- grep -i "$temp" $emp | tee sal;
- echo
- salary=`cut -d "|" -f5 sal`;
- hra=$((( $salary \* 5 ) / 100));
- da=$((( $salary \* 13 ) / 100));
- ta=800;
- tax=$((( $salary \* 5 ) / 100));
- gs=$(( $salary + $hra + $da + $ta));
- ns=$(( $gs - $tax));
- echo "Gross Salary : $gs";
- echo "Neet Salary : $ns";
- ;;
- 6) sort -n $emp;
- ;;
- *) exit
- ;;
- esac
- echo -n "Do You Want To Conti...?"
- read i
- echo "-----------------------------------"
- if [ $i = 0 ]
- then
- exit
- fi
- done
Add Comment
Please, Sign In to add comment