Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
shell scripting
Name: vishab Date: October 3, 2000 at 10:07:04 Pacific
Comment:
my program is as follows echo -n "Enter SSN or q to quit:\c" read SSN while [ $SSN != q ] do # find the record grep $SSN personal # filename personal if [ $? -ne 0 ] then echo "Record does not exist" else #Allow the user to make changes #read does not read fieild ssn ln fn grep $SSN personal |tr ':' ' '|read ssn ln fn old_ssn=$SSN #provide menu to make changes echo "what ( s-ssn, l-ln, f-fn, q - quit):\c" read answer while [ $answer != q ] do case $answer in s) echo "Enter SSN:\c" read ssn ;; l) echo "Enter ln:\c" read ln ;; f) echo " Enter fn:\c" read fn ;; *) echo "not supported choice" ;; esac echo $SSN:$ln:$fn echo " what ( s - ssn, l - ln, f - fn , q -quit ):\c" read answer done #remove old record grep -v $old_ssn personal > temp mv temp personal # insert new one echo $ssn:$ln:$fn >> personal fi echo "Enter ssn or q to quit:\c" read ssn done
# the problem with the script is that it does not allow me to make changes to the old ssn instead it prompts maybe my read mode is not working.......... please help me i am using mandrake 7.0 and am a newbeeeeeeee.
Summary: I would have a question on the command "getopts", if I want to perform a command with an unlimited argument such as: foo -cd {filename1 filename2 filename3.....} in the shell script: while...
Summary: Hi all. Just started using this ver of Slackware and have problem with using mailto in a shell script (used mail in the past and it worked fine). If I have any blank lines in the message it arrives ...
Summary: How to write bourne shell script that will prompt the user for a number and which can be ended only by the user typing STOP. The script should ignore the interrupts from Control +C and Control +\ ...