Posts Tagged ‘SED examples’

SED examples

Posted: April 15, 2016 in Linux
Tags:

sed -i '/^#/d' vendor/broadcom/hammerhead/device-partial.mk #remove all lines beginning with #

sed -i '1,2d' vendor/broadcom/hammerhead/device-partial.mk #delete 1st 2 lines

sed -i 's_:broadcom \\_ _g' vendor/broadcom/hammerhead/device-partial.mk #replace :broadcom \ with a space

sed -i 's_:system_ system_g' vendor/broadcom/hammerhead/device-partial.mk #replace :system with system

sed -i 's_ vendor/_install -D -m 644 vendor/_g' vendor/broadcom/hammerhead/device-partial.mk #replace vendor/ with install -D -m 644 vendor/

sed '1 i\#!/bin/bash' vendor/broadcom/hammerhead/device-partial.mk #add #!/bin/bash to 1st line