The tag has no wiki summary.

learn more… | top users | synonyms

6
votes
2answers
3k views

Execute command in remote active terminal

Suppose you have a terminal emulator (T1) open with a PID of 6350. From another terminal, type this command (C1): echo "ls\n" > /proc/6350/fd/0 This writes ls and the new line in T1 but does ...
5
votes
3answers
4k views

bash: /dev/stderr: Permission denied

After upgrading to a new release version, my bash scripts start spitting errors: bash: /dev/stderr: Permission denied in previous versions Bash would internally recognize those file names (which is ...
4
votes
2answers
592 views

Can I read and write to the same file in Linux without overwriting it? [duplicate]

Possible Duplicate: How can I make iconv replace the input file with the converted output? I frequently connect to amazon ec2 using their public DNS names ...
1
vote
1answer
130 views

How to see output of a running program over ssh

I use debian 6 on an embedded system which is supposed to run a program called pilot. The OS is configured to login as root without asking password (there is no monitor nor keyboard connected). After ...
3
votes
1answer
365 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. ...
26
votes
4answers
6k views

Can I pipe stdout on one server to stdin on another server?

stdout on one CentOS server needs to be piped to stdin on another CentOS server. Is this possible? Update ScottPack, MikeyB and jofel all have valid answers. I awarded the answer to Scott because, ...
21
votes
3answers
684 views

How can I limit the output speed of stdout?

I'm running CentOS 5.7 and I have a backup utility that has the option of dumping its backup file to stdout. The backup file is rather large (multiple gigabytes). The target is an SSHFS filesystem. To ...
5
votes
2answers
681 views

Why jobs aren't killed at logout when executed with “> /dev/null 2>&1 &”?

When you run jobs like the example below, they're killed when you logout: $ ./job.sh & However, when you execute them as in the below example, redirecting stdout to /dev/null and stderr to ...
3
votes
1answer
303 views

Shell script doesn't paint last line of stdout to screen without user input

I have a shell script that's happily doing all my backup process and writing progress to stderr and stdout, with one exception — the last line doesn't get written to my terminal (if I call the script ...
1
vote
1answer
265 views

selective stdout , stderr and logging using the script command [duplicate]

Possible Duplicate: Show only stderr on screen but write both stdout and stderr to file stdout , stderr and logging using the script command cat test.sh: rm -v foo.tmp date pwd cat ...
1
vote
2answers
324 views

stdout , stderr and logging using the script command

I have remove.sh which contains: rm -v test.tmp And I have install.sh which contains: script remove.log -c './remove.sh' What can I do so that whether or not test.tmp exists, I don't see any rm ...
6
votes
2answers
3k views

what is meant by connecting STDOUT and STDIN?

This is a newbie question. I'm reading a book, it says: Every process has at least three communication channels available to it: “standard input” (STDIN), “standard output” (STDOUT), and ...
1
vote
4answers
3k views

Can I access Nth line number of standard output?

Assuming a script that outputs a list of files: $> bash someScript.sh path/to/some/file path/to/the/file/i/want/to/work/with path/to/yet/another/file Now I want to have the second file-path as ...
7
votes
3answers
4k views

bash: Use a variable to store stderr|stdout redirection

Is there any way to redirect stdout and stderr via variable like adding command options in script? For example I have a script: #!/bin/bash -x TEST=">/dev/null 2>&1" OPT='-p -v' mkdir $OPT ...
1
vote
3answers
998 views

routing wget --recursive to stdout (as in -O -) rather than a file

I want to "scan" a website content, recursively, and pipe it to another program. When I run: wget -r -O - $SITE I get WARNING: combining -O with -r or -p will mean that all downloaded content ...
4
votes
1answer
2k views

Writing to stdout except for output redirection C

I have to make a simple app for school. I have to write arguments one per line on the terminal, and return on stdout the user choices. For example, I write cat my_app main.c main.h, if the user ...
1
vote
1answer
61 views

Can I use tail with a file both as input and destination?

I have a log file that gets big fast. I tried using tail with this syntax but it didn't work. tail logfile.log -n 100000 > logfile.log The output file is 0 bytes and blank. What am I doing ...
2
votes
4answers
2k views

How to limit the number of lines a command's output has available in bash?

I started downloading a big file in the background using $ nohup wget http://example.tld/big.iso & which also gives me a nohup.out file that includes the output of wget. Now, if I later want ...
8
votes
3answers
383 views

Is there a way to execute a native binary from a pipe?

echo 'main(){}' | gcc -xc - -o /dev/stdout | ??? Is there a way to run the output binary on a unix-like system? EDIT: I needed it to run the output of g++ in a sandboxed environment where I can't ...
4
votes
4answers
255 views

How to send stderr to stdout with a pipe to another command?

I'm trying to capture all of the output of a build operation, and send it to myprogram. I seem to only be able to capture part of it. This is what I'm trying: make clean && make ...
1
vote
5answers
801 views

Display output to console while grep is used

In vim I use the following command to compile a tex file: pdflatex\ \-file\-line\-error\ \-shell\-escape\ \-interaction=nonstopmode\ $*\\\|\ grep\ \-P\ ':\\d{1,5}:\ ' this works in terms of getting ...
0
votes
1answer
197 views

Printing file content with grep

Is it possible to print to the console all file content using only grep command? (wihtout cat, less, echo, more...)
5
votes
1answer
440 views

Is it possible to “fork” STDOUT to two different locations? [duplicate]

Possible Duplicate: Is there a way in bash to redirect output and still have it go to stdout? Let's say I do: ps -ef | grep httpd to see if apache is running or not, but I also want to ...