Name: qakalla Date: November 17, 2006 at 17:11:11 Pacific Subject: how to create config.bat file OS: XP CPU/Ram: 2.8 Model/Manufacturer: HP
Comment:
This is in Unix Shell Scripting. using Putty.exe The application I'm working on is to add,remove and update the information of a person.I need help to create a file config.bat so it will automatically create the person's ID number. I would like to start from 1000 then add 1 everytime I add a person. This is the code I have to add the person. I'm missing the ID number.
answer=y while [ "$answer" = y ] do clear echo -e "First Name: \b\c " read first clear echo -e "Last Name: \b\c" read last clear echo -e "M: \b\c " read m clear echo -e "Street: \b\c" read street clear echo -e "City: \b\c" read city clear echo -e "State: \b\c" read state clear echo -e "Zipcode: \b\c" read zip echo -e "Telephone: \b\c" read phone echo "$first:$last:$m:$street:$city:$state:$zip:$phone" >> store_data.txt echo -e "Any more to add? (Y)es or (N)o> _\b\c" read answer case $answer in [Yy]* ) answer=y ;; * ) answer=n ;; esac done
when u run the program for the first time, add 1000 as ID and keep adding one each time it runs.. i haven't tested this piece of code but u can work around to it...
Thanks for your help. On the same application i have to search the person with the id i entered.and display the info only by id.I will post the code on the search part, thanks again.
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE