Solved

search/replace

Posted on 1998-07-17
8
218 Views
Last Modified: 2010-04-21
I have a bunch of files that all end in
*.sql*
I need to replace all of the ";" with " ".
I have a little script called sr.cgi but it only works one file at a time.  Can anyone tell me a quick command line way to do this?
0
Comment
Question by:asago
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 5

Expert Comment

by:n0thing
ID: 2008845
Do you have perl on your system ??
0
 
LVL 1

Expert Comment

by:mikegrb
ID: 2008846
you should also be able to accomplish what it appears you desire with sed
0
 

Author Comment

by:asago
ID: 2008847
I have access to both.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 84

Expert Comment

by:ozo
ID: 2008848
What command line are you now using?
0
 
LVL 1

Accepted Solution

by:
mikegrb earned 50 total points
ID: 2008849
perl -i -ne 's/;/ /g; print;' *.sql

That should do it... if not let me know of any errors or some such that you get and I will fix it up :)
0
 
LVL 84

Expert Comment

by:ozo
ID: 2008850
 or
perl -i -pe 'tr/;/ /' *.sql*
0
 
LVL 1

Expert Comment

by:mikegrb
ID: 2008851
Yes, tr/// would be faster and I guess print isn't required

. /me consults docs ...

yes print isn't required as ozo the master of all things technologically related has pointed out (note this *IS* a complement meant to be taken positivley :)
0
 

Author Comment

by:asago
ID: 2008852
Thanks!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Move nodes from one TSM to another. 3 95
LINUX ZIP - UNCOMPRESS WINDOWS PATH 3 108
Writing a UNIX script menu allowing for multiple options. 5 91
centos commands 6 88
Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

713 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