LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Other *NIX
User Name
Password
Other *NIX This forum is for the discussion of any UNIX platform that does not have its own forum. Examples would include HP-UX, IRIX, Darwin, Tru64 and OS X.

Notices


Reply
  Search this Thread
Old 04-07-2009, 07:23 PM   #1
daemoneye
LQ Newbie
 
Registered: Apr 2009
Distribution: Crunchbang
Posts: 4

Rep: Reputation: 0
Search and Replace in bash script


Hello. I'm looking for some advice on a bash script I'm writing for Mac OSX. The script is replacing a line of html code to change a image name to that of the image in the directory. There can be up to three images in each directory (125 of them). Is there a way to do a find and replace?
 
Old 04-08-2009, 01:24 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Have a look at the "sed" command.
 
  


Reply



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
Does anyone know of a bash script can search & replace txt in a file. jimwelc Linux - Newbie 6 09-15-2008 12:13 AM
Bash search and replace utility cpedros Programming 3 03-12-2008 01:02 PM
Search and Replace from bash hammertime1983 Linux - Newbie 4 11-02-2007 03:18 PM
Trying to make a script that will search and replace text in a file Jongi Programming 28 07-08-2007 12:37 PM
Need a script to search and replace text in file using shell script unixlearner Programming 14 06-21-2007 10:37 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Other *NIX

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