sed adding a space every time I run it
I am using this to comment out lines that are not already commented out
Code:
sed -i '/^#/!s/\(.*\)/# \1/g' /var/rpi/scripts/display Code:
sed -i '/omxplayer-youtube/s/^#//g' /var/rpi/scripts/display Code:
sed -i 's/^[ \t]*//' /var/rpi/scripts/display How can I stop the space from being added to the start of the line? Thanks |
You told it to add the blank character in your first sed.
Fix it. |
The comment expression adds the space after the '#', the uncomment expression only removes the '#' leaving the added space.
Fix it by either not adding the space, or by removing the space. |
All times are GMT -5. The time now is 10:43 AM. |