Tagged Questions
0
votes
2answers
116 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 ...
2
votes
2answers
44 views
redirecting std output and std error
I have been trying to figure out the relationship between file descriptors. One thing I don't understand is, how is:
ls -l /bin/usr > ls-output.txt 2>&1
different from:
ls -l /bin/usr ...
1
vote
1answer
447 views
How can I get vsftpd version into shell variable?
I want to get vsftpd version into shell variable. I can get it to console with ease:
# vsftpd -version
vsftpd: version 2.2.2
Also I can get a lot of other info into variable:
# i=`bash --version ...
1
vote
2answers
115 views
Redirecting tr stdout to a file [duplicate]
Possible Duplicate:
How can I make iconv replace the input file with the converted output?
Can I read and write to the same file in Linux without overwriting it?
$ cat test.txt
This is a ...
10
votes
2answers
417 views
Redirect stderr from an already running script
I've been running a script for several days now. I redirected stdout to $HOME/mylog, but didn't redirect stderr since I thought there would be nothing on it. Suddenly thousands of lines started coming ...
3
votes
1answer
179 views
Append output to a file and redirect stderr to null
How can I append the result of a command to a file and redirect stderr to null?
5
votes
2answers
391 views
Wrapping a shell script with tee
There is a bash script which prints some logs and allows some arguments. The script prints the logs to STDOUT.
Let's say the script's name is AAA.sh
I'd also like to make the script to print the logs ...
3
votes
1answer
276 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.
...
3
votes
1answer
268 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 ...
5
votes
2answers
2k 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 ...
7
votes
3answers
2k 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 ...