http://qs1969.pair.com?node_id=915699


in reply to Re: $` $' in bash??
in thread $` $' in bash??

It's silly to keep using the bad variables instead of /p if you're going to use the English names.

perl -lane '$F[1]=~s/(chr\w[^_]?)_.*\b/$1/p;print ${^PREMATCH}. "\t". +$F[1] ."\t" .${^POSTMATCH}'