shell - How to ensure file written with sed w command is closed -
I am using the command 'sed' to get labels from a tax document using labels:
/ \\ Label {[a-zA-Z0- 9] *} / w labels.list
This script is part of a pipeline, in which Later, awk reads the file that Said has just written. E.g.
Cat Bob | Sed -f sedScript | | Sometimes the pipeline generates the correct output, sometimes it does not (exactly the same input file 'for bob'). It's random. I can only conclude that sometime he tries to read the awk file before he has shut it off properly. Anyway, can I force the rabbit to close the file at the end of the script, or what could be the problem of any other suggestion?
All steps for running a pipeline in parallel. It is a very important and defining feature of pipes, and there is nothing that you can do or do to stop or stop it.
Instead, you should rewrite your script so that all data dependencies can be executed and that will end in the order you need it. In the general case, you will bob
. Sed -F sedScript & gt; Tempfile cat tempfile | Awk -f awk script labels.list -
Or equivalently in your case:
grep '\\ label {[a-zA-Z0- 9 ] *} 'Bob & gt; Labels.list awk -f awk script labels.list Bob
Comments
Post a Comment