I have a bunch of output going through sed and awk.
How can I prefix the output with START and suffix the answer with END?
For example, if I have
All this code
on all these lines
and all these
How could I get:
START
All this code
on all these lines
and all these
END
?
My attempt was:
awk '{print "START";print;print "END"}'
but I got
...
START
All this code
END
START
on all these lines
END
START
and all these
END
This works, as indicated by jasonwryan:
awk 'BEGIN{print "START"}; {print}; END{print "END"}'
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加