All Questions
Tagged with stdout text-processing
6 questions
6
votes
2
answers
316
views
How does `cat`'s I/O model differ from that of other utilities?
From the output of stdbuf --help (GNU):
Usage: stdbuf OPTION... COMMAND
Run COMMAND, with modified buffering operations for its standard streams.
...
NOTE: If COMMAND adjusts the buffering of its ...
23
votes
2
answers
4k
views
Pipes, how do data flow in a pipeline?
I don't understand how the data flows in the pipeline and hope someone could clarify what is going on there.
I thought a pipeline of commands processes files (text, arrays of strings) in line by line ...
3
votes
5
answers
9k
views
How to overwrite stdout using echo? [closed]
We know to overwrite bar.txt, we can use this:
echo "foo" > bar.txt
but how can we overwrite to the standard output? I tried this command:
echo "foo" >
but it failed. I want this because I ...
8
votes
5
answers
7k
views
How do I break up a file like split to stdout for piping to a command?
I have a large .sql file full of SELECT statements that contain data I want to insert into my SQL Server database. I'm looking for how I could basically take the file's contents, 100 lines at a time, ...
2
votes
2
answers
1k
views
Show a sliding window of output from a program
I want to run a command (rsync -av) and only display 10 lines of output at any time. I have found a similar post, but I don't want to redirect it to a file.
I want the output to be displayed ...
36
votes
6
answers
24k
views
How do I make python programs behave like proper unix tools?
I have a few Python scripts laying around, and I'm working on rewriting them. I have the same problem with all of them.
It's not obvious to me how to write the programs so that they behave like ...