The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
dynamic editing using shell script habzone2007 Shell Programming and Scripting 1 05-14-2008 11:55 PM
editing a file via a shell script ?? jimmyc Shell Programming and Scripting 2 03-28-2008 12:21 PM
Reading file names from a file and executing the relative file from shell script anushilrai Shell Programming and Scripting 4 03-10-2006 05:25 AM
Editing files in shell programing nir_s Shell Programming and Scripting 0 07-13-2005 05:53 AM
Editing a file using a script Ypnos Shell Programming and Scripting 45 07-02-2003 10:39 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 02-07-2005
jowpup jowpup is offline
Registered User
  
 

Join Date: Feb 2005
Posts: 2
Editing a file in a shell script

Using Solaris 8.
I need to create a shell script that will edit a text file.
I need to look in the text file and do a search and replace. For instance, the text file name is always 'filename'. I need to open filename and replace every instance of 'oldtext' with 'newtext'. 'oldtext' is static. newtext is a variable that I will pass to the shell via the 'read' command further up in the script.
I've got most of the script written....I can pass the variables and create directorys, copy files etc, but I don't know how to edit a text file in a shell.

Thanks,
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:35 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0