Perl: the Markov chain saw | |
PerlMonks |
Re: Sed in perlby SBECK (Chaplain) |
on Oct 11, 2018 at 12:48 UTC ( [id://1223864]=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|