New answers tagged

0

Thanks Giles, I now realize I miss-understood the terminology of 'focus'. I want to focus the terminal but only have the web browser viable. A basic method (Openbox 3.5.2, Raspbian, Pi3). Edit rc.xml to include a window focus key-binding, e.g. keybind key="W-x" <action name="PreviousWindow"> <finalactions> <action name="Lower"/&...


0

The message from ldapsearch is being printed to the stderr stream, which is not being caught before the | while. If you had been trying to redirect it with just a >, that would explain why it wasn't working inside the loop. If you want to capture ldapsearch's error output, change your script to: #!/bin/bash for i in $(seq 20000); do ldapsearch -x -...


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


0

The proper syntax would be: $ unzip <(curl -sL https://www.winpcap.org/archive/1.0-docs.zip) but it won't work, because of the error (Info-ZIP on Debian): lseek(3, 0, SEEK_SET) = -1 ESPIPE (Illegal seek) Archive: /dev/fd/63 End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one ...


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/...


0

Another variation on the theme, getting all pertinent fields, avoiding external calls to awk or sed (uses read, which in bash is a built in) IFS=' +' read in_full in_part _x _x \ out_full out_part _x _x \ bytes _x _x _x _x seconds _x speed speed_units < <( echo $(dd if=/dev/zero of=/dev/null bs=1024 count=7 2>&1) ) echo -e "$bytes bytes ...


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....


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 ...


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.


0

Because a ssh commnand take all stream from standard input, fed by the while statement, You can use a pipe to switch the stdin of ssh to another source: echo "" | ssh ... example : while read HOST ; do echo "" | ssh $HOST "uname -a" ; done < servers.txt stdin input of all ssh commands in a while loop must be switched to another source.


0

It turns out it is just as easy... prog 2>&1 > output.log | tee error.log


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 ...



Top 50 recent answers are included