Sponsored Content
Full Discussion: Doubt in sed
Top Forums UNIX for Dummies Questions & Answers Doubt in sed Post 302597342 by Sri3001 on Friday 10th of February 2012 03:03:44 AM
Old 02-10-2012
Thanks

But if you see the below set of codes ,
[xstif@cletld3 ~]$ cat sri1.txt
\
'
"
[xstif@cletld3 ~]$ sed 's/\"/\\\"/g' sri1.txt
\
'
\"
[xstif@cletld3 ~]$ sed "s/\'/\\\'/" sri1.txt
\\'
'\'
"\'


Its putting \' on the end of every line why is that ..
 

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. UNIX for Advanced & Expert Users

Doubt in SED command

PLEASE EXPLANIN ME... sed 's~\(.*\)\(<name>\)\(.*\)\(</name>\)\(.*\)~\2\3\4~' this is the format <start><name>123<\name><addr>BAC<\addr><loc>sfo<\loc></start> (1 Reply)
Discussion started by: gksenthilkumar
1 Replies

4. Shell Programming and Scripting

Basic SED doubt

Hi Friends!! I want to add a / at the end of a number. for example i have CQ65758 /, in this case i want to shift that backspace one space to the left so the my result becomes CQ65758/. How can i do that with sed. Thanks Adi (3 Replies)
Discussion started by: asirohi
3 Replies

5. Shell Programming and Scripting

A sed doubt - need explanation

Hi, The following command works fine for me, but I could not grasp the logic working behind of sed command, it's obscure to me :( :confused: echo "./20080916/core/audioex.amr" | sed "s%\(\)/%\1_%g" o/p: ./20080916_core_audioex.amr Could anyone please explain to me in detail, that how... (6 Replies)
Discussion started by: royalibrahim
6 Replies

6. Shell Programming and Scripting

sed command doubt

i have input files like this SFE_DOC_DATE (SFE_DOC_DATE:UniChar.:): "04/18/20" SFE_PSTNG_DATE (SFE_PSTNG_DATE:UniChar.:): "04/18/20" SFE_CREATEDON (SFE_CREATEDON:UniChar.:): "05/31/20" SFE_CLEAR_DATE (SFE_CLEAR_DATE:UniChar.:): "(NULL)" SFE_CLR_DOC_NO... (3 Replies)
Discussion started by: Gopal_Engg
3 Replies

7. 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

8. Shell Programming and Scripting

sed doubt in extracting

Hi, Can anyone help me in understanding how the below code works? echo "texxt" | sed 's///' gives output exxt, ideally it should give xxt. as this should remove the chars which is not x. echo 'x_a_b_a_c_a_d' | sed 's/.*\(a\)/\1/' gives output as a_d, which should be 'a' as it's the only... (2 Replies)
Discussion started by: royalibrahim
2 Replies

9. UNIX for Dummies Questions & Answers

sed basic doubt

Hi , what is the equivalent of below awk in sed. awk '$1=="ABC"&&$2=="XYZ" {print $0}' infile Thanks, Shruthi (6 Replies)
Discussion started by: shruthidwh
6 Replies

10. Shell Programming and Scripting

sed q predicate doubt

Hi, Could anyone please explain me what the following command does? sed -ne "/\"$var\"/{=;q}" file (1 Reply)
Discussion started by: royalibrahim
1 Replies
WWW::RobotRules(3)					User Contributed Perl Documentation					WWW::RobotRules(3)

NAME
WWW::RobotRules - database of robots.txt-derived permissions SYNOPSIS
use WWW::RobotRules; my $rules = WWW::RobotRules->new('MOMspider/1.0'); use LWP::Simple qw(get); { my $url = "http://some.place/robots.txt"; my $robots_txt = get $url; $rules->parse($url, $robots_txt) if defined $robots_txt; } { my $url = "http://some.other.place/robots.txt"; my $robots_txt = get $url; $rules->parse($url, $robots_txt) if defined $robots_txt; } # Now we can check if a URL is valid for those servers # whose "robots.txt" files we've gotten and parsed: if($rules->allowed($url)) { $c = get $url; ... } DESCRIPTION
This module parses /robots.txt files as specified in "A Standard for Robot Exclusion", at <http://www.robotstxt.org/wc/norobots.html> Webmasters can use the /robots.txt file to forbid conforming robots from accessing parts of their web site. The parsed files are kept in a WWW::RobotRules object, and this object provides methods to check if access to a given URL is prohibited. The same WWW::RobotRules object can be used for one or more parsed /robots.txt files on any number of hosts. The following methods are provided: $rules = WWW::RobotRules->new($robot_name) This is the constructor for WWW::RobotRules objects. The first argument given to new() is the name of the robot. $rules->parse($robot_txt_url, $content, $fresh_until) The parse() method takes as arguments the URL that was used to retrieve the /robots.txt file, and the contents of the file. $rules->allowed($uri) Returns TRUE if this robot is allowed to retrieve this URL. $rules->agent([$name]) Get/set the agent name. NOTE: Changing the agent name will clear the robots.txt rules and expire times out of the cache. ROBOTS.TXT The format and semantics of the "/robots.txt" file are as follows (this is an edited abstract of <http://www.robotstxt.org/wc/norobots.html>): The file consists of one or more records separated by one or more blank lines. Each record contains lines of the form <field-name>: <value> The field name is case insensitive. Text after the '#' character on a line is ignored during parsing. This is used for comments. The following <field-names> can be used: User-Agent The value of this field is the name of the robot the record is describing access policy for. If more than one User-Agent field is present the record describes an identical access policy for more than one robot. At least one field needs to be present per record. If the value is '*', the record describes the default access policy for any robot that has not not matched any of the other records. The User-Agent fields must occur before the Disallow fields. If a record contains a User-Agent field after a Disallow field, that constitutes a malformed record. This parser will assume that a blank line should have been placed before that User-Agent field, and will break the record into two. All the fields before the User-Agent field will constitute a record, and the User-Agent field will be the first field in a new record. Disallow The value of this field specifies a partial URL that is not to be visited. This can be a full path, or a partial path; any URL that starts with this value will not be retrieved Unrecognized records are ignored. ROBOTS.TXT EXAMPLES The following example "/robots.txt" file specifies that no robots should visit any URL starting with "/cyberworld/map/" or "/tmp/": User-agent: * Disallow: /cyberworld/map/ # This is an infinite virtual URL space Disallow: /tmp/ # these will soon disappear This example "/robots.txt" file specifies that no robots should visit any URL starting with "/cyberworld/map/", except the robot called "cybermapper": User-agent: * Disallow: /cyberworld/map/ # This is an infinite virtual URL space # Cybermapper knows where to go. User-agent: cybermapper Disallow: This example indicates that no robots should visit this site further: # go away User-agent: * Disallow: / This is an example of a malformed robots.txt file. # robots.txt for ancientcastle.example.com # I've locked myself away. User-agent: * Disallow: / # The castle is your home now, so you can go anywhere you like. User-agent: Belle Disallow: /west-wing/ # except the west wing! # It's good to be the Prince... User-agent: Beast Disallow: This file is missing the required blank lines between records. However, the intention is clear. SEE ALSO
LWP::RobotUA, WWW::RobotRules::AnyDBM_File COPYRIGHT
Copyright 1995-2009, Gisle Aas Copyright 1995, Martijn Koster This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.2 2012-02-18 WWW::RobotRules(3)
All times are GMT -4. The time now is 08:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy