LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-05-2007, 01:01 PM   #1
sang_froid
Member
 
Registered: Oct 2006
Posts: 179

Rep: Reputation: 15
help with awk


Hi

I have a file which has a line as below:

DirIcons="/images"


I need to convert the above line to

DirIcons="/test"

How do I do it with awk from command prompt ?

Thanks a lot
 
Old 07-05-2007, 01:35 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Just one line??---Use an editor.
OR:
sed -i 's:/images:/test/:' filename
(changes all cases of "/images" to "/test")

For really good sed and awk tutorials, search Google using "grymoire sed" and "grymoire awk"
 
  


Reply


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
awk aggressivebloodcell Linux - Newbie 3 07-02-2007 11:51 PM
Help with awk kshkid Programming 1 12-22-2006 05:59 AM
Do you know awk? Vitalka Programming 5 12-01-2006 10:42 PM
using awk meniscus Linux - Newbie 6 10-05-2006 12:39 PM
using awk wedgeworth Linux - Newbie 9 02-20-2004 07:48 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:33 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