Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: $` $' in bash??

by JavaFan (Canon)
on Jul 20, 2011 at 20:16 UTC ( [id://915739]=note: print w/replies, xml ) Need Help??


in reply to $` $' in bash??

Using a standard trick to include a single quote:
perl -lane '$F[1]=~s/(chr\w[^_]?)_.*\b/$1/;print $`. "\t". $F[1] ."\t" + .$'"'"
The single quote directly following the $ matches the first single quote. In Perl, this will end a string, but not so in the shell - here single quotes act like \Q/\E in Perl. Directly following the $ and the single quote is "'", which for the shell is just a single quote. Which makes that the Perl program ends in $', as intended.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-19 06:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found