How do i make input start with a letter?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How do i make input start with a letter?
# 1  
Old 12-03-2014
How do i make input start with a letter?

Howdy folks,
How do i make the input start with a letter and certain num of numbers and if anything else is entered it should display error

for ex; a123455 is good ( exactly 7 characters)

and
ex: sio234234 is not good
ex: b233 is not good..
ex: jlasjdlfks is not good

Any help is appreciated.

Thanks
CK
# 2  
Old 12-03-2014
Code:
case "$INPUT" in
[a-z][0-9][0-9][0-9][0-9][0-9][0-9])
        echo "$INPUT is good"
        ;;
*)
        echo "$INPUT is bad"
        ;;
esac

This User Gave Thanks to Corona688 For This Post:
# 3  
Old 12-04-2014
It is working. TY
This User Gave Thanks to coolkid For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace specific letter in a file by other letter

Good afternoon all, I want to ask how to change some letter in my file with other letter in spesific line eg. data.txt 1 1 1 0 0 0 0 for example i want to change the 4th line with character 1. How could I do it by SED or AWK. I have tried to run this code but actually did not... (3 Replies)
Discussion started by: weslyarfan
3 Replies

2. Shell Programming and Scripting

Counting all words that start with a capital letter in a string using python dictionary

Hi, I have written the following python snippet to store the capital letter starting words into a dictionary as key and no of its appearances as a value in this dictionary against the key. #!/usr/bin/env python import sys import re hash = {} # initialize an empty dictinonary for line in... (1 Reply)
Discussion started by: royalibrahim
1 Replies

3. Solaris

How to make SMF service start last?

I need to start a service among the last on a freshly booted system. Via the manifest, I've made it dependent on very milestone on the computer yet the service still comes back with an error that a kstat variable in the kernel does not exist. I run it right the service process right there... (6 Replies)
Discussion started by: JWH
6 Replies

4. Shell Programming and Scripting

Make all words begin with capital letter?

I need to use bash to convert sentences where all words start with a small letter into one where all words start with a capital letter. So that a string like: are utilities ready for hurricane sandy becomes: Are Utilities Ready For Hurricane Sandy (10 Replies)
Discussion started by: locoroco
10 Replies

5. Shell Programming and Scripting

Check input for lenght, special characters and letter case

I made menu script for users so they can run other script without going in shell just from menu. But i must control their input. These are criteria: Input must have 4 signs First two signs are always lower case letters Input shall not have some special signs just letters and numbers ... (1 Reply)
Discussion started by: waso
1 Replies

6. UNIX for Dummies Questions & Answers

How to make alias for start of next sessiones

Good morning Dear Friends Please tell me how can be don't alias which is not Temporary.I mean in next log it to be there specially for AIX and HP UNIX.Thanks in advance. (0 Replies)
Discussion started by: papa1980
0 Replies

7. Shell Programming and Scripting

How can I make a program start up automatically after the computer restart/startup?

hi all How can I make a program start up automatically after the computer restart/startup in fedora? something like: ... Establish a shell then run some of command code. Thanks for Help!! (1 Reply)
Discussion started by: munna_dude
1 Replies

8. Shell Programming and Scripting

Start Input not on next line?

I'm curious also to find if it is possible to begin input in this manner $script.sh input where the user enters 'script.sh' but the input goes directly next to the command instead of the new line. \c doesn't seem to work but I think it should be possible. Has anyone done this before? Its... (4 Replies)
Discussion started by: nortypig
4 Replies

9. Shell Programming and Scripting

how to find capital letter names in a file without finding words at start of sentence

Hi, I want to be able to list all the names in a file which begin with a capital letter, but I don't want it to list words that begin a new sentence. Is there any way round this? Thanks for your help. (1 Reply)
Discussion started by: kev269
1 Replies

10. Shell Programming and Scripting

Script to make a new workspace and start jobs

Hi Does any have a script that can make a new workspace and name it and then start a named terminal window and then do a command in that window? E.g.: Make a new window called top (to see the processes) start an xterm window called top and then do an rlogin to a host and run top to see the... (0 Replies)
Discussion started by: laho
0 Replies
Login or Register to Ask a Question