Re: Need help with sed syntax

From: laura fairhead (run_signature_script_for_my_email_at_INVALID.com)
Date: 09/29/03


Date: Mon, 29 Sep 2003 07:27:57 GMT

On Mon, 29 Sep 2003 09:14:28 +0200, Petterson Mikael <mikael.petterson@era.ericsson.se> wrote:

>Hi,
>
>I am testing the following line to see if it is possible to replace row
>3 with,
>
>public static final int HW_TEST_RESULT_DEF_VALUE = 0;
>
>I am using the folloing sed line on the file below:
>
> sed 's/^\(public static final int [A-Z_]* = \);/\10;/'
>StrxDeviceGroupMo.java
>
>but I see no change in the output on screen.
>
>Any ideas what could be wrong?

Your pattern matches 'public static....' at the very start of the line
but the file data you show is indented with whitespace.

byefornow
l

>
>//Mikael
>
>
>Part of StrxDeviceGroupMo.java
>===============================
>
> public static final String HW_TEST_RESULT_ATTR_TYPE = "Integer";
> public static final String HW_TEST_RESULT =
>"hwTestResult";
> public static final int HW_TEST_RESULT_DEF_VALUE = ;
> public static final int HW_TEST_RESULT_STP_VALUE = 1;
> public static final int HW_TEST_RESULT_MIN_VALUE = 0;
> public static final int HW_TEST_RESULT_MAX_VALUE = 3;
> public static final String HW_TEST_RESULT_MANDATORY = "optional";
> public static final String HW_TEST_RESULT_READWRITE = "readOnly";
> public static final String HW_TEST_RESULT_PERSISTENT= "false";

-- 
echo alru_aafriehdab@ittnreen.tocm |sed 's/\(.\)\(.\)/\2\1/g'


Relevant Pages

  • Re: help me out with subroutines
    ... It's also worth mentioning that *echo* isn't trimming the whitespace ... The *shell* tokenizes the command line on whitespace, ...
    (comp.unix.questions)
  • Re: redirecting in the middle of a code
    ... Cannot modify header information - headers already sent by ... any print or echo statement to have caused this. ... posted only a small portion of the code and the offending echo or whitespace ... Hint: Do what Paul said. ...
    (comp.lang.php)
  • Re: [PHP] ereg help!
    ... echo substr-3).'com'; ... have a drop in slideshow page and a drop in videoshow page ... of though is that whitespace isn't accommodated, ... file name with white space? ...
    (php.general)
  • Re: [PHP] Include???
    ... On Wed, May 23, 2007 9:24 am, Dan Shirah wrote: ... Perhaps there is some whitespace before/after the 'C'... ... The echo of my status_code retruns the correct value so the if should ...
    (php.general)
  • Re: Replacing lines in a file
    ... >Note that ex is standardized by POSIX while ed is not. ...
    (comp.unix.shell)