Using sed to edit textfiles

  1. 2 years ago
    Edited 2 years ago by emil.larsson

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

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

    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.

  2. clonedeploy

    14 Jun 2016 Administrator Answer

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

  3. Thanks!

    That worked perfectly :D

 

or Sign Up to reply!