User information script


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers User information script
# 1  
Old 11-01-2008
User information script

Hi Guys,

I just started learning unix and was wondering if anyone can assist me with my User info script.The script file lets the user input their personal information (Their name, address, phone number etc...). The script will then ask the user to input the info again if the input is incorrect or not given. This is what I entered so far :

Finished=f
while [ "$Finished" = f ]
do
tput cup 6 9; echo -n "Enter your phone number: "; read phone
while [ "$phone" = "<not sure how to set this up>" ]; do
echo "Please enter your phone number: "; read phone
done


My question is how do I setup my while loop so that if the user enters his phone number in the wrong format it will prompt him to enter the phone number correctly ?

Thanks very much for the assistance
# 2  
Old 11-01-2008
What shell are you using? What would a valid phone number be?
# 3  
Old 11-02-2008
Shell would be Bash and a valid phone number would be
###-###-####
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Create a shell script to gather user account information and displays the result to administrator

I want to create a shell script to gather user account information and displays the result to administrator. I have created a script but its showing all the information when i search for username like: amit@mx:~$ ./uinfo.sh amit Username : amit User Info ... (2 Replies)
Discussion started by: amit1986
2 Replies

2. Shell Programming and Scripting

Shell script for user login information.

Hi Gurus, I need help in writing a script which should say which user has used or logged in in the server from past one month using FTP or TELNET and the output should be of the form Username Service NumberofTimes Date. Thanks in Advance. ---------- Post updated at 04:01 PM... (1 Reply)
Discussion started by: rama krishna
1 Replies

3. Solaris

How to see the root information from user loging account?

Hi friends when ever user tried to loging to the server from the user account.we can see the from who -u command.this was fine shut@erpqas $ who -u ipadmin pts/1 Mar 18 16:05 old 157 (10.5.23.74) ipadmin pts/3 Mar 19 08:29 old 11076 ... (3 Replies)
Discussion started by: tv.praveenkumar
3 Replies

4. Solaris

How to find user information from NIS client

Hi All, I have logged into a solaris NIS server by using NIS username and password in an clinet machine, how can i get my user details like in which group iam whats my user ID , group ID etc....... Kindly help (2 Replies)
Discussion started by: judi
2 Replies

5. Solaris

command to retrieve user information

Hi, I want the command to retrieve the existing user information such as * authorization * Profile * role * exipre(expiration date of login) * inactive please tell me how to do that Thank you. (3 Replies)
Discussion started by: S_venkatesh
3 Replies

6. HP-UX

FTP user information on destination server

Could any one please tell me how to check the ftp users information on the destination server ( Hp-UX ) ? Source server used to do FTP to my server ( that is destination server ) . Now , he is getting error that login is incorrect and unable to login into destination server . Please tell me how to... (3 Replies)
Discussion started by: randhir
3 Replies

7. Linux

Viewing user accound information

How can dump the user account detail? like how long need to change password, password naming policy, how many times will lock account if login failed.. thk a lot (1 Reply)
Discussion started by: zp523444
1 Replies

8. HP-UX

view user account information

How can dump the user account detail? like how long need to change password, password naming policy, how many times will lock account if login failed.. thk a lot (0 Replies)
Discussion started by: zp523444
0 Replies
Login or Register to Ask a Question