-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dan,
| iostat -c 300 1 | awk '!/[a-zA-Z]|^$/ {print $1}' This doesn't seem to work for me... awk tells me: awk syntax error at source line 1 *** /[a: Event not found. Not sure how to allow awk to delete two top rows of iostat... other that the grep option -v. Does not seem to be working in awk. Dan Nelson wrote: | In the last episode (Jul 14), Hakim Singhji said: | |>I am having problems with a shell script that I am writing. I am |>looking to pipe the output of iostat to awk however the shell is |>hanging... even at the command line it hangs. The code looks like |>this: |> |> # iostat -c 300 2 | egrep -v '[a-zA-Z]|^$' | awk '{print $1}' |> |>This code hangs for me... now when I just pipe iostat through the |>egreped patter it is fine. It's when it is passed to awk that I have |>problems... now of course if I simplify the output to: |> |> # iostat | egrep -v '[a-zA-Z]|^$' | awk '{print $1}' |> |>it works just fine... so it has to be the awk. What is the problem? | | | Actually grep is the culprit. It buffers its output when piped to | another program for efficiency. Try adding --line-buffering, or just | let awk handle your regular expression: | | iostat -c 300 1 | awk '!/[a-zA-Z]|^$/ {print $1}' | | - -- Hakim Singhji New York University "But where danger is, grows the saving power also" (qtd. in Heidegger 28). -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFC1zDrs2AZ6g3dZu8RAqfuAJ48mZRADvVcMHV8WtJJnNKdYNbMSACePPuh 0k0t6z262s40C0+PMarYAV4= =NP1k -----END PGP SIGNATURE----- _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"