2 votes

Problem with a command into Sed

Your issue is that the embedded command substitution is executed even before the sed command is started. It is executed by the shell when it figures out what arguments to call sed with. Instead of ...
Kusalananda's user avatar
  • 335k
1 vote

How to keep previous and current line if the previous line contains common text?

More of a job for awk: awk -v OFS=, ' /^Hello_/{ getline name print $0, name > "file1" print $0, name > "file3" next } { print > "file2"...
Stéphane Chazelas's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible