Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Sed in perl

by SBECK (Hermit)
on Oct 11, 2018 at 12:48 UTC ( #1223864=note: print w/replies, xml ) Need Help??


in reply to Sed in perl

It's hard to see spaces, so I'll replace spaces with underscores for clarity.

In your first example, it looks to me like you're doing:

   $mod = "ABC_";
   $hier = `tac temp.xx | sed -n '/$mod_/,/YYY/ p'| grep XXX`
so with the substitution, your second line is actually:
   $hier = `tac temp.xx | sed -n '/ABC__/,/YYY/ p'| grep XXX`
If I'm misreading the spaces, I apologize, but it appears to me that you're looking for ABC followed by 2 spaces. In the shell command, you're only looking for 1 space.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1223864]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2020-10-24 18:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (246 votes). Check out past polls.

    Notices?