Results 1 to 4 of 4
like I have
var = hello world hello universe
now I want to do search, how can I do that?
ser = "hello"...
- 04-04-2008 #1Linux Newbie
- Join Date
- Jan 2008
- Posts
- 114
Can we do patter matching in a string in Shell
like I have
var = hello world hello universe
now I want to do search, how can I do that?
ser = "hello"Switched to Scripting
- 04-04-2008 #2
For simple search, use grep. For search and replace, use sed. Do this at the command line:
If man pages are not installed on your system, google this:Code:man grep man sed
Hope this helps.Code:man grep solaris man sed solaris
--
Bill
Old age and treachery will overcome youth and skill.
- 04-04-2008 #3
You can either pipe the text into grep, or use Bash's regex match operator:
http://www.tldp.org/LDP/abs/html/bas...#REGEXMATCHREFDISTRO=Arch
Registered Linux User #388732
- 04-04-2008 #4Linux Newbie
- Join Date
- Jan 2008
- Posts
- 114
I was expecting both of you

Now again working shell after long time.
Understood
thanksSwitched to Scripting


Reply With Quote