Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 1
    All those cut, sed, and paste calls could be replaced by a single awk call. Commented Apr 25, 2020 at 3:57
  • @HaukeLaging That was how we were told to do it. Commented Apr 25, 2020 at 4:03
  • @Yoshi24517 Calling sed and cut so many times inside a loop is definitely to be avoided, no matter what you have been taught by some professor. awk would be a much better fit and you could probably replace that long section of code within the inner if statement with a single call to awk. Also, more is a pager, i.e. a utility for displaying text for looking at. To copy files, use cp. Commented Apr 25, 2020 at 7:50