Sponsored Content
Full Discussion: Telephone Format and Check
Top Forums Shell Programming and Scripting Telephone Format and Check Post 302996474 by mrn6430 on Wednesday 26th of April 2017 02:49:17 PM
Old 04-26-2017
Telephone Format and Check

How can I script to check telephone number entered by user in a uniz script:

Code:
print -n "Enter telephone number to check ? " ; read telno

How do I script to :
1) Check if entered without dashes or with dashes
2) If without dashes how can I check:
if telno is only 10 digits, if so convert it to ###-###-#####
3) IF already has dashes and contains 10 digits, then continue?

Thank you
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

telephone working in unix

sir, i came to know that telephone exchanges use unix for the working of telephones,that is when we take our hand set in telephone we can note a dial sound,for this telephone exchanges use unix. we are going to do project using unix,i want to know wheater we can able to connect... (1 Reply)
Discussion started by: radheesh
1 Replies

2. IP Networking

all about telephone in unix

hai to all, that i came to know all telephone exchanges use unix.i want to know wheather we can connect telephones uaeing unix,if it possible means how&and also i need about more information about "telephones in unix" ... (1 Reply)
Discussion started by: radheesh
1 Replies

3. UNIX for Dummies Questions & Answers

Got connected with Modem but cannot dial Telephone no. to connect to host

Hello There, I configure my Modem as follow. Step1. # admintool & Then from Browse --> Serial Port i select tta port and Edit --> Modify From that i select Template : Modem:Dial Out Baud Rate: 9600 Ok Step 2 # tip /dev/cua/a connected (1 Reply)
Discussion started by: abidmalik
1 Replies

4. Shell Programming and Scripting

Check the format of Date

Hi, I have a date field in my input file. I just want to check if its in the format "DD-MM-YYYY". Is there any command which can achieve this? Thanks and Regards, Abhishek (2 Replies)
Discussion started by: AAA
2 Replies

5. UNIX for Dummies Questions & Answers

File format check

How to check if file is in a given format? For instance: if file records are delimeted with "|" ( pipes) and have exactly 26 fields? File is pretty big (~3 mil reccords), so not sure if I have to check all records or just head/tail records or smth. Any ideas are much much more than... (11 Replies)
Discussion started by: Leo_NN
11 Replies

6. Shell Programming and Scripting

Check input date format?

how to check input date format. for example $input_date must be in format dd.mm.gg script is execute like this: bin/script1.sh 14.12.2009 script1.sh code: #!/bin/sh input_date=$1 CMD="/app/si/test/test.sh $input_date" echo "*****" $CMD (2 Replies)
Discussion started by: waso
2 Replies

7. Homework & Coursework Questions

Telephone book script

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Hi, here is my other assignment for the week. Create a shell script for a telephone book application. ... (7 Replies)
Discussion started by: Jagst3r21
7 Replies

8. Shell Programming and Scripting

Check Date Format And Email Out

Hello All, I have a requirement where i need to get the EXTRACT_DATE from a file and check if the date is of valid format or not and then mail it if it is not valid. Appreciate if you can help me with this. I did the following so far. awk '{for(i=1;i++<=NF;)if($i~/^EXTRACT_DATE/) print $i}'... (11 Replies)
Discussion started by: Ariean
11 Replies
ct(1C)							      Communication Commands							    ct(1C)

NAME
ct - spawn login to a remote terminal SYNOPSIS
ct [options] telno... DESCRIPTION
The ct utility dials the telephone number of a modem that is attached to a terminal and spawns a login process to that terminal. The telno is a telephone number, with equal signs for secondary dial tones and minus signs for delays at appropriate places. (The set of legal char- acters for telno is 0 through 9, -, =, *, and #. The maximum length telno is 31 characters). If more than one telephone number is speci- fied, ct will try each in succession until one answers; this is useful for specifying alternate dialing paths. ct will try each line listed in the file /etc/uucp/Devices until it finds an available line with appropriate attributes, or runs out of entries. After the user on the destination terminal logs out, there are two things that could occur depending on what type of port monitor is moni- toring the port. In the case of no port monitor, ct prompts: Reconnect? If the response begins with the letter n, the line will be dropped; otherwise, ttymon will be started again and the login: prompt will be printed. In the second case, where a port monitor is monitoring the port, the port monitor reissues the login: prompt. The user should log out properly before disconnecting. OPTIONS
The following options are supported: -h Normally, ct will hang up the current line so that it can be used to answer the incoming call. The -h option will prevent this action. The -h option will also wait for the termination of the specified ct process before returning control to the user's terminal. -sspeed The data rate may be set with the -s option. speed is expressed in baud rates. The default baud rate is 1200. -v If the -v (verbose) option is used, ct will send a running narrative to the standard error output stream. -wn If there are no free lines ct will ask if it should wait, and for how many minutes, before it gives up. ct will continue to try to open the dialers at one-minute intervals until the specified limit is exceeded. This dialogue may be overridden by specifying the -wn option. n is the maximum number of minutes that ct is to wait for a line. -xn This option is used for debugging; it produces a detailed output of the program execution on stderr. n is a single number between 0 and 9. As n increases to 9, more detailed debugging information is given. FILES
/etc/uucp/Devices /var/adm/ctlog ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWbnuu | +-----------------------------+-----------------------------+ SEE ALSO
cu(1C), login(1), uucp(1C), ttymon(1M), attributes(5) NOTES
The ct program will not work with a DATAKIT Multiplex interface. For a shared port, one used for both dial-in and dial-out, the ttymon program running on the line must have the -r and -b options specified (see ttymon(1M)). SunOS 5.10 14 Sep 1992 ct(1C)
All times are GMT -4. The time now is 11:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy