linux - Replace first space with other string in file with Bash script -
For example, I have a string like "Test Test Test" in a file, to create a "1 Test Test Test" I want to replace the first place with '1'
I tried do not use the option sed -i "s / ^ \ / \ 1 \ / g" on text .txt , it will convert all the spaces to '1', so I would like to know how to make it only after getting it first?
'g' in this way (global replacement) :
sed 's / 1 /'
Comments
Post a Comment