Skip to main content
fixed formating according to convention
Source Link
Archemar
  • 32.3k
  • 18
  • 75
  • 107

I'd suggest you using tsts utility from moreutils package. Though its primary purpose is prepending output lines with a time stamp, it can use an arbitrary string along or instead of the timestamp

for line in {01..05}; do echo $line; done | ts  "A string in front "
A string in front  01
A string in front  02
A string in front  03
A string in front  04
A string in front  05

I'd suggest you using ts utility from moreutils package. Though its primary purpose is prepending output lines with a time stamp, it can use an arbitrary string along or instead of the timestamp

for line in {01..05}; do echo $line; done | ts  "A string in front "
A string in front  01
A string in front  02
A string in front  03
A string in front  04
A string in front  05

I'd suggest you using ts utility from moreutils package. Though its primary purpose is prepending output lines with a time stamp, it can use an arbitrary string along or instead of the timestamp

for line in {01..05}; do echo $line; done | ts  "A string in front "
A string in front  01
A string in front  02
A string in front  03
A string in front  04
A string in front  05
Source Link
Tagwint
  • 2.5k
  • 1
  • 17
  • 22

I'd suggest you using ts utility from moreutils package. Though its primary purpose is prepending output lines with a time stamp, it can use an arbitrary string along or instead of the timestamp

for line in {01..05}; do echo $line; done | ts  "A string in front "
A string in front  01
A string in front  02
A string in front  03
A string in front  04
A string in front  05