Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Many Files - Change

Posted on 1997-05-02
3
Medium Priority
?
196 Views
Last Modified: 2010-04-21
I am using C-shell .

I would like to change the contents of many files at once
i.e. change say the occurrence of 'xyz' in many files to
'abc' .
All the files are in one directory .

I guess I need to create an executable file - I've tried one
starting with '# /bin/csh -f' and this works OK .

Thanks - Brian Roberts
0
Comment
Question by:BlueFin
3 Comments
 

Accepted Solution

by:
fsgreen earned 200 total points
ID: 2006259
here's a script that will do it:

#!/bin/csh
foreach i (*)
sed s/"xyz"/"abc"/ < $i > tempfile
mv tempfile $i
end

      doug.
0
 

Author Comment

by:BlueFin
ID: 2006260
This is the first time I've used experts-exchange and the
answer I have received solves my problem .
I am very pleased with this .
I am not sure about your grading system re
excellent and good - as I don't know how easy my
question was to answer for an expert .
0
 

Expert Comment

by:smagt
ID: 2006261
There also exists a program called "fgres" - fast grep and substitute, available from several ftp servers.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question