10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I wanted to find and replace an email id from entire directory structure on a Linux server. I found that find . -type f -print0 | xargs -0 sed -i 's/abc@yahoo.com/xyz@gmail.com/g' would do it perfectly.
But my search criteria has extended and now I want to search for a string1 like... (2 Replies)
Discussion started by: pat_pramod
2 Replies
2. Shell Programming and Scripting
Hi there,
I am using AIX and trying to search and replace a string with another string in multiple files in different directories.
I wanted to search replace in steps so I don't change all of the instance anywhere in the server at once, minimizing impact.
STEP 1:
--------
I first searched... (5 Replies)
Discussion started by: zaino22
5 Replies
3. Shell Programming and Scripting
cat rf|nawk '/Use SSL= 0/{n+=1}{if (n==3){sub("Use SSL= 0","Use SSL= 0x1",$0)};print }' > rf2Fails.
sed 's/Use SSL= 0/Use SSL= 0x1/g' rf > rf2Fails.
In addition, the goal is to ONLY replace the 2nd occurence of the... (15 Replies)
Discussion started by: rfransix
15 Replies
4. Shell Programming and Scripting
Hi Guys
file:///C:/DOCUME%7E1/c104058/LOCALS%7E1/Temp/moz-screenshot.pngsed 's///g' /source/filename.txt > /destination/filename.txt
The above code deletes the characters which are not A-Z, a-z and 0-9, but I wanted to replace it with space without deleting them.
Any help is... (2 Replies)
Discussion started by: gowrishankar05
2 Replies
5. Shell Programming and Scripting
Dear Friends,
I have a flat file from which I want to remove single "space". And, wherever two spaces are provided it should replace it by only one space.
E.g.
I have
N A T I O N A L E D U C A T I O N F O R O R G AN I S A T I ON S
I want
NATIONAL EDUCATION FOR ORGANISATIONS
Please... (5 Replies)
Discussion started by: anushree.a
5 Replies
6. Shell Programming and Scripting
i have a file like::
$ cat space
asd
fghj
itkg
now i want to replace the next line with . and thn this . with the 100 spaces.
cat space | tr '\n' '.', it woked for me, to replce the new line to .
Now i want to replace this . with 100 spaces.
Thanks in advance. (10 Replies)
Discussion started by: Prashant Jain
10 Replies
7. Shell Programming and Scripting
Hi,
I tried making a shell script which recursively search in a given directory for all files *.txt and then search and replace some text and after that
save each file as $filename.dynamips.txt
I would like to get this done with sed. I tried but couldn't get it to work.
BTW this is not... (1 Reply)
Discussion started by: 2bone
1 Replies
8. Shell Programming and Scripting
Hi ,
I have a directory structure as dir and subdirectories and files under it and so on.now I need to find the files which contain the search string under every dir and subdir and replace .
my search string is like
searchstring=/a/b
string to be replaced=/a/c/b
please help.
... (7 Replies)
Discussion started by: mohanpadamata
7 Replies
9. Shell Programming and Scripting
Hi guys, so I have another issue. Can I use sed to replace spaces in a string or variable with %20
I am having trouble with using curl on URL's containing spaces
Thanks! (12 Replies)
Discussion started by: tret
12 Replies
10. Shell Programming and Scripting
I need a script that will replace all occurances of a string in all filenames and foldernames, recursively.
Right now I have this script:
for f in `find -name *eye*`; do
echo processing $f
g=`expr "xxx$f" : 'xxx\(.*\)' | tr 'eye' 'm'`
mv "$f" "$g"
done
The problem is that tr... (2 Replies)
Discussion started by: TheMJ
2 Replies