Using sed to edit textfiles



  • What version of sed are you using in the boot image?

    Tested this command on ubuntu:
    [b]sed -i "s/^value3=.*/value3=$cust_attr_1/" "$varFile"[/b]

    The output is correct with a newline and value4=.

    When i run the script from within the boot image after deployment.
    This is the file before:
    value1=asd
    value2=1
    value3=2
    value4=3

    This is the file after:
    value1=asd
    value2=1
    value3=test123value4=3



  • It is 4.2.2, I have run into the same issue and have just added \r in my replace section.



  • Thanks!

    That worked perfectly 😄