Replace only First Word in Line

I have query to replace the first word in line using below code but its replace the middle word too

sed -i 's/load /# LOAD/' /tmp/check.sql

Query 1 :

UPDATE accheadcon_data_last_upload SET last_upload_date = '2017-07-23'

Replace to

UPDATE accheadcon_data_last_up# LOAD SET last_upload_date = '2017-07-23'

I want only load to be change when it comes as First Word

Anchor it at BOL: s/^load/.../ ...

1 Like