Sponsored Content
Top Forums Shell Programming and Scripting A sed doubt - need explanation Post 302237700 by majormark on Thursday 18th of September 2008 07:44:10 AM
Old 09-18-2008
replaces all "/" characters with "_" for every line that starts with "."
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

doubt it sed

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

2. UNIX for Dummies Questions & Answers

doubt in sed

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

3. Shell Programming and Scripting

sed command explanation needed

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

4. Shell Programming and Scripting

Explanation for interesting sed behaviour?

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

5. Shell Programming and Scripting

sed doubt...

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

6. UNIX for Dummies Questions & Answers

SED command explanation

can someone please explain the below sed command.. sed 's/\(*|\)\(.*\)/\2\1/' (6 Replies)
Discussion started by: raghu_shekar
6 Replies

7. UNIX for Dummies Questions & Answers

Explanation of the command sed -n -e 's_.*>\(.*\)<.*_\1_p' filename.xml

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

8. Shell Programming and Scripting

sed sorting command explanation

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

9. UNIX for Dummies Questions & Answers

Doubt in sed

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

10. Shell Programming and Scripting

sed command explanation

Will someone give me an explanation on how the sed command below works. sed 's/.*//' Thanks! (3 Replies)
Discussion started by: scj2012
3 Replies
HTML::Entities(3)					User Contributed Perl Documentation					 HTML::Entities(3)

NAME
HTML::Entities - Encode or decode strings with HTML entities SYNOPSIS
use HTML::Entities; $a = "V&aring;re norske tegn b&oslash;r &#230res"; decode_entities($a); encode_entities($a, "200-377"); DESCRIPTION
This module deals with encoding and decoding of strings with HTML character entities. The module provides the following functions: decode_entities($string) This routine replaces HTML entities found in the $string with the corresponding ISO-8859/1 (or with perl-5.7 or better Unicode) charac- ter. Unrecognized entities are left alone. encode_entities($string, [$unsafe_chars]) This routine replaces unsafe characters in $string with their entity representation. A second argument can be given to specify which characters to concider as unsafe. The default set of characters to expand are control chars, high-bit chars and the '<', '&', '>' and '"' characters. Both routines modify the string passed as the first argument if called in a void context. In scalar and array contexts the encoded or decoded string is returned (and the argument string is left unchanged). If you prefer not to import these routines into your namespace you can call them as: use HTML::Entities (); $encoded = HTML::Entities::encode($a); $decoded = HTML::Entities::decode($a); The module can also export the %char2entity and the %entity2char hashes which contain the mapping from all characters to the corresponding entities. COPYRIGHT
Copyright 1995-2001 Gisle Aas. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.8.0 2001-11-05 HTML::Entities(3)
All times are GMT -4. The time now is 11:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy