Hot answers tagged

4

The second form of I/O redirection (<(cmd)) simply doesn't behave the same way as the first form (cmd | other-cmd). The first connects the output of cmd to the input of other-cmd, but the second substitutes either a /dev/fd path or a named pipe path in for the command. The standard output of cmd is tied to the other end of that pipe, but this only ...


2

Newer ssh seem to bring back stdout and stderr from the remote host as two distinct streams. To create a filter that combines both stdout and stderr you could do: ssh $filer lun show <lunpath> 2>&1 |grep vol To send stderr to a separate file, you could do: ssh $filer lun show <lunpath> 2>lun.show.stderr |grep vol if [ -s lun.show....


2

If we look at the sources we can see function report() which is used to print messages can be configured to write to stderr, or to use syslog(3) to get them logged. It also depends on what level of logging you configure. You can see if the command is doing any writes or syslog calls with eg: strace -e write,connect -o /tmp/out tac_plus ... Look the tmp ...


2

This is occurring because the output for v3.3.6 was going to stderr, not stdout. Apparently, prior to v3.4.0 the output from python --version is sent to stderr, whereas in v3.4.0 and later this output is sent to stdout. Redirection of both stdout and stderr to the output file works just fine: python --version >> $fname 2>&1


1

Thanks to grochmal and steeldriver for the ideas. The answer was to use <<< #!/bin/bash # declare number COUNTER=0 END=$(bc <<< -2^10) while [ $COUNTER -gt $END ]; do nc -nv [IPADDRESS] [PORT] <<< $COUNTER let COUNTER=COUNTER-1 done If you want more information about here strings it can be found at: http://www.tldp.org/...


1

$ echo <(echo "hi") /dev/fd/63 /dev/fd/63 is not SQL, therefore sqlite3 fails with the indicated error message. cat by contrast is pretty good at reading files (or also from standard input). The named pipe or /dev/fd file of the <(list) construct created is not standard input.



Only top voted, non community-wiki answers of a minimum length are eligible