Linked Questions

5
votes
3answers
653 views

Why does this one-liner fail to produce output? [duplicate]

The following produces nothing in bash: while true ; do upower -d ; sleep 1 ; done | grep percentage | uniq I've discovered that it doesn't matter what the last- or even the second to last- program ...
1
vote
1answer
1k views

Using tee or pipe to log console output will cause my program not to start [duplicate]

I'm running hostapd on my raspberry PI to let it function as an accesspoint. It's working fine with the following command: sudo hostapd /etc/hostapd/hostapd.conf This will start hostapd and log all ...
1
vote
1answer
613 views

Flush data to file frequently for long running command? [duplicate]

I have a command that processes data slowly. The command processes lines from a file and writes the results to the output file data.txt: my_command > data.txt The issue I have is that I'd like to ...
1
vote
1answer
973 views

Filter out duplicate lines of tail -f [duplicate]

I often need to tail -f apache access logs for websites to troubleshoot issues- one thing that makes it annoying is that anyone loading a page once may cause 12+ lines to get written to the log, and ...
-1
votes
1answer
353 views

Why doesn't this simple piping with awk work? [duplicate]

I'm trying to follow this answer but I can't make it work. I simplified it down as much as I could to try work out what's going on (just running this at the terminal for now): rsync --progress -iav ...
1
vote
1answer
208 views

strange behaviour of strings command [duplicate]

I am trying to capture mysql traffic and pass those traffic to strings command as follows: tcpdump -i any -s 0 -l -w - dst port 3306 | strings This is working as expected and printing all mysql ...
1
vote
1answer
253 views

Pipe blocks with the following sequence of commands [duplicate]

I have a script that reads a file that contains urls and then prints out the ip addresses. However, I am unable to find resources as to why the pipe blocks when I add the command cut -d" " -f4 at ...
1
vote
2answers
123 views

locate(1) buffers its output [duplicate]

I'm using locate(1) from GNU findutils for a little task and it seems as if it buffers its output. I am piping the output of locate to another task that will process the lines as locate finds them. ...
0
votes
1answer
105 views

Why isn't program output being greped? [duplicate]

When I run sudo wpa_supplicant -Dwext -iwlan3 -cwifi.conf 2>&1 I get: Successfully initialized wpa_supplicant ioctl[SIOCSIWAP]: Operation not permitted ioctl[SIOCSIWENCODEEXT]: Invalid ...
0
votes
0answers
38 views

Confusion about output lost in pipeline with perl [duplicate]

I want to ping a remote system, and have the date show up in my output, and then feed it along the pipeline to another program. I used cat in my examples below only to be a simple example. I can use ...
1
vote
0answers
35 views

Getting awk value and outputting to a file [duplicate]

I need to get a value from a log file which I am getting using awk at the moment. I can get the number printing on the console but when I try to put that value into a new file nothing happens. Here is ...
0
votes
0answers
30 views

How can I save a command output to a file in real-time? [duplicate]

How can I save a command output to a file in real-time? For example, if my command is python log.py where log.py contains: import time print('testing') time.sleep(100) # sleeping for 100 seconds ...
0
votes
1answer
22 views

Running command on each line of output immediately [duplicate]

I found out that when I run a command which executes a software that has continuous output lines e.g. traffic monitor like tcpdump or tshark the command keeps counting numbers on screen like 4, 8, 12 ....
140
votes
6answers
137k views

How big is the pipe buffer?

As a comment in I'm confused as to why "| true" in a makefile has the same effect as "|| true" user cjm wrote: Another reason to avoid | true is that if the command produced ...
20
votes
3answers
2k views

grep doesn't output until EOF if piped through cat

Given this minimal example ( echo "LINE 1" ; sleep 1 ; echo "LINE 2" ; ) it outputs LINE 1 and then, after one second, outputs LINE 2, as expected. If we pipe this to grep LINE ( echo "LINE 1" ; ...

15 30 50 per page