![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Korn: How to loop through a string character by character | shew01 | Shell Programming and Scripting | 10 | 12-02-2008 07:58 AM |
| bash script to check the first character in string | ole111 | Shell Programming and Scripting | 2 | 03-19-2008 12:34 AM |
| read string, check string length and cut | ozzy80 | Shell Programming and Scripting | 9 | 03-21-2007 05:56 PM |
| converting character string to hex string | axes | High Level Programming | 5 | 09-20-2006 01:04 PM |
| how to check first character in var's value. | yongho | UNIX for Dummies Questions & Answers | 7 | 07-01-2005 11:22 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
|||||
|
Here are a couple of threads which turned up using the search feature. Do use the search feature.
How to check whether a string is number or not String Validation program ksh : find value type |
|
|||||
|
Those links were meant to be a starting point. I think you understood the code snippets in each. Try to write one based on your understanding. And the when you face an issue, post the code you have so that we can help you better.
|
|
|||||
|
hey....vino.....
if i could able to solve on my own..i sudn't post it here.... so help me out...i tried each post provided in replied to this post by you.....but fortunately ya unfortunately...i didn't find a single method..which will help me out in bash .......if you could help me , then please..... while implying this one....+([a-zA-Z]) , ?(+|-)+([0-9]) and *([0-9]|[a-zA-Z])*...i am getting -bash: syntax error in conditional expression: unexpected token `(' -bash: syntax error near `+([' any idea......???? |
|
|||||
|
Quote:
Anyway, this should get you started. Code:
[/tmp]$ cat try.sh
#! /bin/sh
for sample in abc 123 abc123
do
if [[ $sample == *[[:alpha:]]* ]] ; then
echo $sample
fi;
done
[/tmp]$ ./try.sh
abc
abc123
[/tmp]$
Last edited by vino; 10-05-2007 at 08:50 AM.. Reason: revised. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|