10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Will someone give me an explanation on how the sed command below works.
sed 's/.*//'
Thanks! (3 Replies)
Discussion started by: scj2012
3 Replies
2. UNIX for Dummies Questions & Answers
Hi All
Can some one explain what does the given two sed commands do :confused:
sed "s/\'/\\\'/g" |
sed 's/\"/\\\"/g'
Please find the sample code i used to find out what this is doing , but it has confused me more :wall:
$ cat sri1.txt
\
'
"
$ sed 's/\"/\\\"/g' sri1.txt
\
'... (5 Replies)
Discussion started by: Sri3001
5 Replies
3. Shell Programming and Scripting
sed '$!N; /^\(.*\)\n\1$/!P; D'
i found this file which removes duplicates irrespective for sorted or unsorted file. keep first occurance and remove the further occurances.
can any1 explain how this is working..
i need to remove duplicates following file. duplicate criteria is not the... (3 Replies)
Discussion started by: mukeshguliao
3 Replies
4. UNIX for Dummies Questions & Answers
Hi Friends,
I am trying to modify a script .The script contains this line:
sed -n -e 's_.*>\(.*\)<.*_\1_p' filename.xml
I am not great in sed command.I know, it is regular expression
to match a pattern string that starts with s_ and ends with 1_.I doesnot give the desired result.
Can... (4 Replies)
Discussion started by: rajsharma
4 Replies
5. UNIX for Dummies Questions & Answers
can someone please explain the below sed command..
sed 's/\(*|\)\(.*\)/\2\1/' (6 Replies)
Discussion started by: raghu_shekar
6 Replies
6. Shell Programming and Scripting
Hi,
i need find and replace a sting with a new variable having value as spaces in between.
Eg:
set a = "i am variable"
set b = "i am second"
sed -e 's/find_string/'$a'/g' -e 's/find2_str/'$b'/g' input_file
here it is giving error...
How to get an varaible, which is... (6 Replies)
Discussion started by: vasanth.vadalur
6 Replies
7. Shell Programming and Scripting
This is my first post so hi to you all. I have browsed these forums in the past and what a great community and resource this is! Thanks to all the contributors ... I look forward to being able to give something back.
In the meantime, I have a little conundrum concerning sed. My very simple... (6 Replies)
Discussion started by: Gavster
6 Replies
8. Shell Programming and Scripting
Hi,
Could you please explain me the below statement -- phrase wise.
sed -e :a -e '$q;N;'$cnt',$D;ba' abc.txt > xyz.txt
if suppose $cnt contains value: 10
it copies last 9 lines of abc.txt to xyz.txt
why it is copying last 9 rather than 10.
and also what is ba and $D over there in... (4 Replies)
Discussion started by: subbukns
4 Replies
9. UNIX for Dummies Questions & Answers
hi all,
i have a variable exported as
VAR=ATTRIB
then tried with,
echo "tt" | sed 's/^/$VAR/'
expected result as
ttATTRIB
but obtained only,
$VARtt
i could nt get where i am wrong.
Thanks. (3 Replies)
Discussion started by: matrixmadhan
3 Replies
10. Shell Programming and Scripting
Hello..
i want to use variable in sed..
like
sed 's/ROOTMAILID/$variable/g' conf.test
but its not working..
please help
thanks in advance
esham (2 Replies)
Discussion started by: esham
2 Replies