Aside from using a temporary file to help, is there a way/program could buffer input from stdin
but does not output the contents until getting the EOF
. I don’t want to use a shell variable either(e.g. buffer=$(cat)
).
I want to output a file’s contents while they change, for example if I have the file foobar
and I do:
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, and pass it to the commands I have set to do the rest.
After upgrading to a new release version, my bash
scripts start spitting errors:
While in vim
I can write a range of lines from the file I’m viewing to another file. For example,
The system may provide non-standard extensions. These are features not required by POSIX.1-2008 and may include, but are not limited to: […] Additional character special files with special properties (for example, /dev/stdin
, /dev/stdout
, and /dev/stderr
)
I’d like to take a program P
that reads from stdin
& writes to stdout
, but connect it to nc
or whatever such that it reads from a certain port and outputs to another port.
How does one go about using diff
to compare the output of two commands?
I have a bash application that is producing some result, and I’d like to echo the result to either stdout
or to a user chosen file. Because I also echo other interactive messages going to the screen, requiring the user to explicitly use the >
redirection when he wants to echo the result to a file is not an option (*), as those messages would also appear in the file.