2
votes
4answers
71 views

Command line 'buffer' [duplicate]

I wanted to tail the last 100 lines of a file to the same file, but the command tail -n 100 file > file doesn't work, I assume because the stdout gets written to the file 'live', before everything ...
4
votes
2answers
78 views

How to redirect stdout to a file and read from the same file simultaneously with another task?

I want to run a task (which takes quite a long time) remotely in Ubuntu Linux Bash via nohup and redirect stdout to a file, e.g.: nohup task > out.txt & From time to time I would like to ...
2
votes
4answers
98 views

Can a running script identify the logging context?

Let us say I redirect the STDOUT, STDERR of a program to files. ./script.sh 1> output.log 2> error.log Can the running program find this out i.e. know the paths to these files?
0
votes
2answers
471 views

Redirecting stdin with stdout to file

So I have a program that takes in user input and outputs text based on the input. EDIT2: I want to create a script that runs a C executable and the script feeds the C program input from a file and ...
3
votes
1answer
408 views

Redirecting/grep'ing an existing shell's STDOUT

I run a lot of long running processes (simulations) that print progress to STDOUT. I occasionally forget to redirect to STDOUT to a file I can grep, and it's usually too far along to restart. ...