Re: Facing problem with perl one-liner for single quote
- From: noreply@xxxxxxxxx (Gunnar Hjalmarsson)
- Date: Fri, 31 Aug 2007 05:54:38 +0200
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>
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
.
- Follow-Ups:
- Re: Facing problem with perl one-liner for single quote
- From: John W. Krahn
- Re: Facing problem with perl one-liner for single quote
- References:
- Facing problem with perl one-liner for single quote
- From: Krishnan Hariharan
- Facing problem with perl one-liner for single quote
- Prev by Date: Re: Facing problem with perl one-liner for single quote
- Next by Date: Re: Facing problem with perl one-liner for single quote
- Previous by thread: Re: Facing problem with perl one-liner for single quote
- Next by thread: Re: Facing problem with perl one-liner for single quote
- Index(es):