LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-06-2009, 07:07 AM   #16
Techno Guy
Member
 
Registered: Dec 2008
Posts: 62

Original Poster
Rep: Reputation: 15

Quote:
Originally Posted by PMP View Post
Inspired by ghostdog :-)


Code:
echo This is just quick little test | awk 'IGNORECASE = 1 {gsub(/test|just|this/,".")}1'
Code:
# echo This is just quick little test | awk 'IGNORECASE = 1 {gsub(/test|just|this/,".")}1'
This is . quick little
.

It doesn't work. (running Debian 5
Code:
# awk -W version
mawk 1.3.3 Nov 1996, Copyright (C) Michael D. Brennan
Edit:
Never mind, I just updated it, and it works now!
Thanks!
Code:
# awk -W version
GNU Awk 3.1.6

Last edited by Techno Guy; 07-06-2009 at 07:11 AM.
 
Old 07-06-2009, 07:14 AM   #17
PMP
Member
 
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 381

Rep: Reputation: 58
Well Techno Guy,
It worked for me
I am beginner to awk ghostdog might answer your quesiton, you can use sed option that i have given or

Code:
 echo This is just quick little test | perl -e 'while (<>) { s/this|just|test/./ig; print}'
 
Old 07-06-2009, 07:14 AM   #18
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
IGNORECASE is gawk feature. if there is no way you can use gawk, then no choice, use tolower()
 
Old 07-06-2009, 07:16 AM   #19
Techno Guy
Member
 
Registered: Dec 2008
Posts: 62

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by ghostdog74 View Post
IGNORECASE is gawk feature. if there is no way you can use gawk, then no choice, use tolower()
Yeah I just realized, I just installed gawk
All works fine now.

Thanks so much for your help guys.
You guys have overwhelmed me with options
Until next time

Last edited by Techno Guy; 07-06-2009 at 07:18 AM.
 
  


Reply

Tags
regex, sed


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi-line find/replace with GnuWin32 Sed Question EdrickV Programming 4 04-26-2009 01:32 PM
Use sed to find and replace a url xmrkite Linux - Software 4 10-10-2007 07:20 PM
sed - find and replace command bullshit Programming 9 01-05-2006 03:25 AM
SED;find and replace;help required gd13 Programming 3 12-21-2004 06:33 AM
Search and Replace: Asian Words to English Words ieeestd802 Linux - Software 0 10-27-2004 07:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration