Gunnar Hjalmarsson wrote:
Krishnan Hariharan wrote:
I am trying a one-liner substitution for a content in
a file.
original file content
---------
signal TCLK_IN : std_logic;
signal TPOS_IN : std_logic; ---------
I want to change it as:
---------
signal TCLK_IN : std_logic;
signal TPOS_IN : std_logic := '0';
-------
I wrote this one liner,
perl -pi -e 's/signal TPOS_IN \: std_logic;/signal
TPOS_IN \: std_logic \:= \'0\';/' <file_name>
But here i get an error saying, "Unmatched single
quote".
Use double-quotes instead, at least if you are on Windows.
perl -pi"orig_*" -e "s/(TPOS_IN[^;]+)/$1 := '0'/" <file_name>
If you do that the shell will interpret $1 as one of its variables.
If the OP were on windows then he won't have been able to use single quotes
for the original.
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/