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*

7
  • 2
    after you calll system("command") you want the whole pipeline to stop, or you want the pipeline to continue but for awk to never call system again? Commented Mar 23, 2019 at 14:08
  • Note that system() runs sh to interpret the command not bash. If you want to start bash to interpret bash specific code, you'll need to construct sh code that runs bash -c bash-specific-code-here where that bash-specific code will have to be quoted as per sh rules. Commented Mar 23, 2019 at 17:28
  • @JeffSchaller I want the tail -F to continue watching the file but to run the system() command only once for each time matches are found, regardless of how many matches there are. Commented Mar 24, 2019 at 13:56
  • I'm having trouble putting together these two phrases: "run the system() command once" -- and -- "each time matches are found, regardless of how many matches there are". Do you want the command run for the first match, and that first match only? Commented Mar 24, 2019 at 14:02
  • Yes, for the first match only. Commented Mar 24, 2019 at 14:27