1.

Solve : please help with making script!?

Answer»

In school i must write scripts in unix..

I must create:

1) script "add" that add's STUDENTS name, phone number,... in simply database.
that looks-->

echo "$1 $2 $3 $4 $5 $6" >> school.txt

(where $1 - students name, $2 - surname, $3 - telephone number, $4 - number of group, $5 - student's aplication number, $6 - average mark)

2) script that finds student when user enters:
a)students name
b)number of group (in school) and average mark

i created script-->
echo "Choose"
echo "By Name-1 By number of group and average mark-2"
read choice
case $choice in

1) echo "Enter Name"; read name; grep ""$name" .* .* .* .* .*" school.txt;
2)!!! i don't know how to write this part of script !!!
ESAC


please help me write 2'nd choice when user must enter number of group (in school) and average mark in one choice...

i'm working in SLAX live-cd server EDITION..

THANKS!!!!!





You need to learn how to use awk, which will solve all your problems. Try man awk or better still info gawk (not a typo - 'gawk' is the Gnu version of awk found on most Linux systems).ok. thanks! echo "$1 $2 $3 $4 $5 $6" >> school.txt

(where $1 - students name, $2 - surname, $3 - telephone number, $4 - number of group, $5 - student's aplication number, $6 - average mark)

Well, is better:
echo -n "student´s name: "
read $1
echo -n "surname: "
read $2
echo -n "telephone number: "
read $3
echo -n "number of group: "
read $4

and so on....

HARLEQUINCould you let me the entire code you have written?
It´s because I need to test it with my Linux Suse 8.1 shell.

HARLEQUIN



Discussion

No Comment Found