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: local address NATed as 22.214.171.124:48157
david@smurf > more res
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).
why are you trying to redirect before the command as well as after?
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.
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 01:19 PM.|