02-01-2008
Replace a string containing :/=\ in files
I have read many forums about replacing a string in file.
I tested but it doesn't work with my string
For example I want to replace =x=ks24Y\:LOP= with h\P6qwx:aUE/.
Thank you
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I used the following script
cd pathname
for y in `ls *`;
do sed "s/ABCD/DCBA/g" $y > temp; mv temp $y;
done
and it worked fine for finding and replacing strings with names etc. in all files of the given path.
I'm trying to replace a string which consists of path (location of file)
... (2 Replies)
Discussion started by: pharos467
2 Replies
2. Shell Programming and Scripting
Hi,
I have a directory has DIR1 and the D1 directory has 200+ files.
I want change the string from "Bangalore" to "Bangaluru" in all files in the D1 directory.
Thanks (2 Replies)
Discussion started by: koti_rama
2 Replies
3. Shell Programming and Scripting
i need to change string in all files in current folder and all subfolders. i wrote the following script. It works good except it dont delete temp file from subfolders.
for z in `find . -type f -name "*.html" -o -name "*.htm"`; do
sed -e 's@abc@xyz@g' $z>temp;
mv temp $z;
done
any idea?... (1 Reply)
Discussion started by: crazynups
1 Replies
4. Shell Programming and Scripting
Hello Friends,
I've been trying to write a script which finds a string and change it with another string. For this i want to search all files (with its arguments) under a spesific directory and its subdirectories.
For example lets assume i want to replace an IP= 192.168.0.4 with another... (4 Replies)
Discussion started by: EAGL€
4 Replies
5. Shell Programming and Scripting
I'm trying to remove the following string from several files.
<img heigth="1" width="1" border="0" src="http://myteenmovies.net/t.php?id=5540372">I'm using the following script
#!/bin/bash
# This script will search and replace all regular files for a string
# supplied by the user and... (1 Reply)
Discussion started by: d13g0sv
1 Replies
6. Shell Programming and Scripting
Hello.
I have five config files in /etc that I want to edit in one click for testing.
I would like to make a script like this :
#!/bin/bash
#
a_file="/etc/file_1"
src_str="src_string_1"
rpl_str="rpl_string_1"
calling_sed_or_awk_or_whatelse $a_file search_for_all $src_str replace_with... (4 Replies)
Discussion started by: jcdole
4 Replies
7. UNIX for Dummies Questions & Answers
Hi, I'm new to Unix. My understanding of Unix and its command is very limited.
I have about 1000 text files that have a word in it that I need to replace with a different word.
e.g.
a.txt has 1 line of txt: monday, tuesday, wednesday
b.txt has 1 line of txt: monday, tuesday,... (5 Replies)
Discussion started by: millsy5
5 Replies
8. Shell Programming and Scripting
Hello there! I'm having a lot of trouble writing a script.
The script is supposed to:
1) Find all files with the name "Object.mtl" within each folder in the directory: /Users/username/Desktop/convert/Objects
2) Search and replace the string ".bmp" with ".tif" (without the quotations)
3)... (1 Reply)
Discussion started by: Blue Solo
1 Replies
9. Shell Programming and Scripting
Hello,
I need to replace xml version='1.1' with xml version='1.0' in all xml files under /app/jenkins/ in all dir and sub dirs in my CentOS VM, I tried below command but it didn't help, looks like I'm missing a character somewhere.
grep -rl "xml version='1.1'" . | xargs sed -i 's/"xml... (2 Replies)
Discussion started by: mahesh Madpathi
2 Replies
10. UNIX for Beginners Questions & Answers
Hi All,
I need to write a script to find all "*.sh" files in /home file system and if any string find "*.sh" files with the name vijay@gmail.com need to replace with vijay.bhaskar@gmail.com. I just understood about the find the command to search .sh files. Please help me on this.
find / -name... (3 Replies)
Discussion started by: bhas85
3 Replies
LEARN ABOUT OPENDARWIN
segedit
SEGEDIT(1) General Commands Manual SEGEDIT(1)
NAME
segedit - extract and replace sections from object files
SYNOPSIS
segedit [ option ] name ... input_file [-extract segname sectname filename] ... [[-replace segname sectname filename] ... -output out-
put_file]
DESCRIPTION
Segedit extracts and or replaces the named sections from the input_file and creates an output_file (if replacing a section). The segment
and section names are the same as specified to ld(1) with the -segcreate option. The segment and section names of an object file can be
examined with the -l option to otool(1). Only sections in segments that have no relocation to or for them can be replaced (marked with the
SG_NORELOC segment flag) but all sections can be extracted.
The options to segedit(1):
-extract segname sectname filename
Extracts the section specified by the segment name section name pair and places the contents in the specified filename.
-replace segname sectname filename
Will replace the section specified by the segment name section name pair and places and take the new contents for the section from
the specified filename. The -output filename option must also be specified. The resulting size of the section will be rounded to a
multiple of 4 bytes and padded with zero bytes if necessary.
-output output_file
Specifies the output file to create when replacing sections.
SEE ALSO
ld(1), otool(1)
LIMITATIONS
Only mach-O format files that are laid out in a contiguous address space and with their contents ordered in the order of increasing address
can have their segments replaced by this program. This layout is what the link editor produces by default.
Apple Computer, Inc. October 23, 1997 SEGEDIT(1)