Hello,
It is not a fedora question, but I am sure that somebody can help me.
I do: my_sort files.asc > new_file.asc and then gawk -f file.awk -v sampl=T new_file.asc to get what I want.
how can I do the same in a single command with a pipe (and not generating the new_file.asc) ?
Thank.
=========================================================================== Patrick DUPRÉ | | email: pdupre@gmx.com Laboratoire de Physico-Chimie de l'Atmosphère | | Université du Littoral-Côte d'Opale | | Tel. (33)-(0)3 28 23 76 12 | | Fax: 03 28 65 82 44 189A, avenue Maurice Schumann | | 59140 Dunkerque, France ===========================================================================
On 12/16/2017 01:34 PM, Patrick Dupre wrote:
It is not a fedora question, but I am sure that somebody can help me.
I do: my_sort files.asc > new_file.asc and then gawk -f file.awk -v sampl=T new_file.asc to get what I want.
how can I do the same in a single command with a pipe (and not generating the new_file.asc) ?
Assuming you are using bash: gawk -f file.awk -v sampl=T <(my_sort files.asc)
That will work as long as gawk is just going to read the data straight through and not do any seeking.
On 16Dec2017 22:34, Patrick Dupre pdupre@gmx.com wrote:
I do: my_sort files.asc > new_file.asc and then gawk -f file.awk -v sampl=T new_file.asc to get what I want.
how can I do the same in a single command with a pipe (and not generating the new_file.asc) ?
my_sort files.asc | gawk -f file.awk -v sampl=T
Cheers, Cameron Simpson cs@cskk.id.au (formerly cs@zip.com.au)
On 12/16/2017 03:06 PM, Cameron Simpson wrote:
On 16Dec2017 22:34, Patrick Dupre pdupre@gmx.com wrote:
I do: my_sort files.asc > new_file.asc and then gawk -f file.awk -v sampl=T new_file.asc to get what I want.
how can I do the same in a single command with a pipe (and not generating the new_file.asc) ?
my_sort files.asc | gawk -f file.awk -v sampl=T
That's a better option than mine if it works. I assumed that it was requiring a filename, but that could be a wrong assumption.
Hello,
gawk -f file.awk -v sampl=T <(my_sort files.asc) This works very well. Actually, the other suggestions do not work.
On 12/16/2017 01:34 PM, Patrick Dupre wrote:
It is not a fedora question, but I am sure that somebody can help me.
I do: my_sort files.asc > new_file.asc and then gawk -f file.awk -v sampl=T new_file.asc to get what I want.
how can I do the same in a single command with a pipe (and not generating the new_file.asc) ?
Assuming you are using bash: gawk -f file.awk -v sampl=T <(my_sort files.asc)
That will work as long as gawk is just going to read the data straight through and not do any seeking. _______________________________________________ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org
On 17 December 2017 at 01:06, Cameron Simpson cs@cskk.id.au wrote:
On 16Dec2017 22:34, Patrick Dupre pdupre@gmx.com wrote:
I do: my_sort files.asc > new_file.asc and then gawk -f file.awk -v sampl=T new_file.asc to get what I want.
how can I do the same in a single command with a pipe (and not generating the new_file.asc) ?
my_sort files.asc | gawk -f file.awk -v sampl=T
You need to tell gawk to read from the standard input instead of a file so try this: my_sort files.asc | gawk -f file.awk -v sampl=T -