Command output redirection > doesn't print to file
I've used Linux for a while but am stumped. I just installed stun and ran the following:
david@smurf > stunc stun.stunprotocol.org -b > res assign_socket: local socket is bound to 0.0.0.0:48157 stunc_bind_cb: stun_discovery_done stunc_bind_cb: local address NATed as 13.135.7.82:48157 david@smurf > more res david@smurf > i.e. nothing got written to 'res' but continued to be output to screen. What do I need to do to get access to the output? (I need it for a script I'm putting together). Thanks, David (Ubuntu 12.04) |
why are you trying to redirect before the command as well as after?
Code:
[user@server ~]$ nmap -p22 google.com also please use code flags. [ code ] [ / code ] remove the spaces and put your copy/paste from the CLI into them. p.s. if you are putting this into a script, it might be a good idea to use >> instead of > > will create the file and overwrite 100% of data inside the file. >> will create the file if it does not exist and if it does it will "append" to the end of the file the new output. |
Try
Code:
stunc stun.stunprotocol.org -b > res 2>&1 |
As hinted by UnSpawn, stdout (chan 1) is going to the file, but stderr (chan 2) is not, so you need to change that.
@lleb: I don't think that's a re-direct before the cmd, more like the last part of his bash prompt. |
Thanks Sir !!
|
All times are GMT -5. The time now is 02:35 PM. |