sed + replace only if match the first word in line -
the following sed command replaces old
string new
string. target replace old
new
if command
word appears first word in line. how fix sed syntax in order replace old
new
if command
first word in line? (note: command
word location after spaces line beginning.)
lidia
sed "/^ *#/b; /command/ s/old/new/g" file command old old command
after sed exe:
command new new command
"/^[ \t]*command/ s/old/new/g"
Comments
Post a Comment