![]() |
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 |
| First letter of each Word from a line | maxmave | Shell Programming and Scripting | 5 | 04-15-2008 07:52 PM |
| How to filter the words, if that word contains the expected letter | venu_eie | UNIX for Advanced & Expert Users | 3 | 03-19-2008 01:00 PM |
| find a word in a file, and change a word beneath it ?? | vikas027 | Shell Programming and Scripting | 2 | 02-13-2008 04:23 PM |
| how to move word by word on command line | pbsrinivas | UNIX for Dummies Questions & Answers | 1 | 11-23-2007 06:17 AM |
| Can a shell script pull the first word (or nth word) off each line of a text file? | tricky | Shell Programming and Scripting | 5 | 08-17-2006 06:29 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
One way - the && || stuff acts like an "if then else"
Code:
string="plplqabl fghj" myletter="a" echo "$string" | grep -q "$myletter" && echo "$myletter found" || echo "$myletter not found" myletter=x echo "$string" | grep -q "$myletter" && echo "$myletter found" || echo "$myletter not found" |
|
||||
|
Another...
Code:
STRGZ="hello world!!!"
LTR="w"
echo $STRGZ | awk -vc="$LTR" '{if(gsub(c,"")) print "Found";else print "Not Found"}'
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|