Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am running the following command on ubuntu 12.04 bash shell:

hping3 -S -p 80 -c 30 www.google.com >> outputfile.txt

But the problem is that this leaves some lines in the end and doesn't copy in the file. I even tried

hping3 -S -p 80 -c 30 www.google.com >> outputfile.txt 2>&1

It also gives same problem. However this works perfect:

ping -c 30 www.google.com >> outputfile.txt

Any idea about what I might be missing?

share|improve this question
    
The second command works for me under bash 4.2.37(1)-release with hping 3.0.0-alpha-1. The only weird thing I notice is that output from standard error (2>) is written before the standard out (1>file or >file) in the specified redirection file. This is weird because the standard error output appears after standard out when run on a terminal without any redirection. You may want to try something like: hping (...) 2>/tmp/moo.2 1>/tmp/moo.1 ; cat /tmp/moo.1 /tmp/moo.2 –  Ярослав Рахматуллин Nov 5 '12 at 2:16
    
Your suggestion worked. Thanks. –  Gaurav Nov 10 '12 at 9:29
add comment

1 Answer

up vote 0 down vote accepted

Write standard error and standard out to separate files and concatenate them afterwards. Also send the maintainer of this software a mail and ask him kindly to change the app to work like everyone expects.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.