5
votes
3answers
478 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 ...
0
votes
1answer
487 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
318 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
117 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
votes
1answer
117 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
53 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
vote
1answer
40 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 ...
0
votes
0answers
9 views

Pipe output of netcat -k as soon as something is received [duplicate]

I have a nc command that's supposed to save anything received to a file immediately, yet it only dumps everything once I kill the parent process: nc -kl 9876 > log.txt How can I fix that?
0
votes
0answers
7 views

Why can't I pipe my ruby script into lemonbar? [duplicate]

If I try to pipe this ruby script: while true puts "hi" sleep(1) end into lemonbar it does not work. Lemonbar displays nothing. If I run lemonbar manually and type in things, it works just fine....
74
votes
4answers
72k 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 ...
12
votes
4answers
3k views

Stopping output from a program run in SSH session NOW

Problem I execute command that outputs LOTS of information through SSH. For example, I foolishly add debug information inside a loop that executes million times, or just run cat /dev/urandom for ...
5
votes
3answers
6k views

How to stop redirection in bash

I use : exec >script.log 2>&1 in my script to redirect all output to a file. At the end of the script I would like to print a message to the screen. How do I stop the redirection?
7
votes
7answers
2k views

How to grep netcat output

I'm trying to grep live text stream from netcat, but it doesn't work for me: netcat localhost 9090 | grep sender returns nothing, but I'm sure that it should. If I redirect the netcat output to a ...
13
votes
2answers
2k views

“tail -f | iconv -fsjis” does not output anything

I want to tail -f a file, but its content is in sjis encoding, so I need to have it converted to the native (utf-8) encoding of my terminal. When I do tail -f x | iconv -fsjis there will be no ...
2
votes
4answers
1k views

Compare awk vs. grep

I have run below two commands for a very large files grep -E 'string1|string2' 151103*.log|grep 'string3' | grep string4 awk '/string1|string2/ && /string3/ && /string4/' 151103*.log ...

15 30 50 per page