Score:0

How to auto edit the first line content in text file using shell script

cn flag

Here is the file name: SUMAAI011.A01

Here is the file content and would like to rename the first line 01UMAGL011 to 01UMAKBO11

01UMAGL011
0201
0306222021
041063563563
051066675663
063147000
07000
waltinator avatar
it flag
Will `01UMAGL011` appear elsewhere in the file? If not `sed -e 's/
Score:2
it flag

Use sed, the stream editor. Read man sed.

sed -e '1s/01UMAGL011/01UMAKBO11' SUMMAI011.A01

In your question your replacement strings ends in "O11" should it be "011"?

frippe avatar
ug flag
The `-e` doesn't really make a difference here. It does seem, however, the OP is looking for in-place substitution, so it'd probably make more sense to let `-i` take its place.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.