Sponsored Content
Top Forums Shell Programming and Scripting major help needed phone dir script need advancing Post 302348863 by Scott on Sunday 30th of August 2009 06:24:39 AM
Old 08-30-2009
Hi.

You can use a case statement for this
Code:
while [ $# -gt 0 ]; do
  case "$1" in
    [A-Za-z]*[0-9]*) echo "Invalid name: $1";;
    [0-9]*[A-Za-z]*) echo "Invalid number: $1";;
    [1-9]*) echo "Number: $1";;
    [A-Za-z]*) echo "Name: $1";;
    *) echo "Invalid input: $1"
  esac
  shift
done

As you already know how to check if the number is 8 digits, I'll leave that to you

Last edited by Scott; 08-30-2009 at 11:07 AM.. Reason: removed commented code
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to go to a different dir to run a commandline prompt in that dir

Hi, I need to know how I'll be able to write a script that can goto a different dir where I don't have access to read,write and execute and also to run a commandline prompt in that dir with one file whose path has to be specified in that command. Will I be able to do this? Any ideas or... (2 Replies)
Discussion started by: ann_124
2 Replies

2. UNIX for Dummies Questions & Answers

Major Help Urgently Needed!!!!

Right deleted Linux partition usig windows then went to format c:\ but had to exit window now pc ONLY boots into GNU Grub. Does anyone know how to format the hard drive now????? (3 Replies)
Discussion started by: billett05
3 Replies

3. Shell Programming and Scripting

a script to clone a dir tree, & overwrite the dir struct elsewhere?

hi all, i'm looking for a bash or tcsh script that will clone an empty dir tree 'over' another tree ... specifically, i'd like to: (1) specify a src directory (2) list the directory tree/hiearchy beneath that src dir, w/o files -- just the dirs (3) clone that same, empty dir hierarchy to... (2 Replies)
Discussion started by: OpenMacNews
2 Replies

4. Shell Programming and Scripting

Phone Shell Script !?

could you please find a solution for this script (called phone) that creates a simple telephone list (create an empty file called “phonlist” in home directory) . Each line in this file consist of two fields name and the phone number, the script should do the following: When user types the... (1 Reply)
Discussion started by: anything
1 Replies

5. Shell Programming and Scripting

Help me to create a phone book using shell script

Hi guys... can any one help me out with creating a phone book: CP5290 Assignment: Phonebook Due 4 pm Friday 25th September 2009 Weight: 15% You are to implement a Phonebook using Shell scripting and UNIX command line utilities and commands. Some documentation will also be... (1 Reply)
Discussion started by: monster11209
1 Replies

6. Shell Programming and Scripting

A script to find dir, delete files in, and then del dir?

Hello!! I have directories from 2008, with files in them. I want to create a script that will find the directoried from 2008 (example directory: drwxr-xr-x 2 isplan users 1024 Nov 21 2008 FILES_112108), delete the files within those directories and then delete the directories... (3 Replies)
Discussion started by: bigben1220
3 Replies

7. Shell Programming and Scripting

Perl script :- Phone number validation

Hi All, I am doing a perl script validation for Phone numbers. The normal phone number format is 01-32145. I need to do two validations for the phone number 1) A valid phone number can have at least two digits as prefix and at least five digits as postfix. e.g. 01-01011 2) A... (5 Replies)
Discussion started by: subin_bala
5 Replies

8. Shell Programming and Scripting

Need a script to move the files from one dir to other other dir

Need a script to move the files from one dir to other dir and at the same time it has to read the log in the source dir. Please help me ASAP. (4 Replies)
Discussion started by: viswanathkishor
4 Replies

9. Shell Programming and Scripting

Script to move all files in a dir into a certain dir

Hello all, I'm very new to shell scripting and need quite urgently to do this thing for my student job. I have a directory called "vectors" with a bunch of files all named ".vector". also i have for each of those files a directory with the name . I now want to move each of those *.vector files... (2 Replies)
Discussion started by: sherresh
2 Replies
uudemon(4)						     Kernel Interfaces Manual							uudemon(4)

NAME
uudemon.admin, uudemon.cleanu, uudemon.hour, uudemon.poll - Administrative shell scripts for polling remote systems, cleaning up spool directories, reporting status to the system administrator, and routine invocations of the uuxqt and uusched daemons SYNOPSIS
These shell scripts reside in the following directory: /usr/lib/uucp DESCRIPTION
All the scripts can be run from the command line or can be run automatically by the cron daemon. To automatically run the scripts, remove the comment character (#) from the beginning of the relevant line in the /var/spool/cron/crontabs/uucp file. This script reports status to the system administrator. It issues the uustat command to find out the status of uucp jobs. It mails the results to the uucp login ID. The script may be modified to send mail to any login ID such as the uucp administrative login ID (uucpa) or root. This script cleans up the /var/spool/uucp and /var/spool/uucppublic directories by running the uucleanup command. The uucleanup com- mand is run with the following parameters: -C7, -D7, X2, -o2, -W1. This script runs the uusched and uuxqt daemons in the background. This script polls the systems listed in the /usr/lib/uucp/Poll file. The uudemon.poll script should be scheduled before the uudemon.hour script. This allows uudemon.poll to create any command files before cron runs the uudemon.hour script. FILES
Contains the uudemon.admin, uudemon.cleanu, uudemon.hour and uudemon.poll files. Contains the uucp file. RELATED INFORMATION
Commands: cron(8), uucleanup(8), uusched(8), uuxqt(1) Files: /usr/lib/uucp delim off uudemon(4)
All times are GMT -4. The time now is 06:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy