9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi there,
I need to execute a command in the bash. The program prints some standard (output and) error and then wants the user to choose one of several options and type the according input. I am trying to solve this issue in a bash script but also running into some circular dependency. How can I... (7 Replies)
Discussion started by: fredestet
7 Replies
2. Shell Programming and Scripting
Hi all,
can someone help me with the next redirection?
i want to redirect the stdout+stderr of a command to the same file (this i can do by prog &> file)
but in addition i want to redirect only the stderr to a different file.
how can i do this please? (in BASH)
thanks. (4 Replies)
Discussion started by: eee
4 Replies
3. UNIX for Dummies Questions & Answers
Hallo,
i have a script like:
if ;then
echo "OK"
else
echo "ERROR $2 is missing"
fi;
if ;then
touch $2
fi;
if ;then
cat $1 | grep xy > $2 (1 Reply)
Discussion started by: eightball
1 Replies
4. Shell Programming and Scripting
Can somebody explain to me why the diff output is not going to stderr?
Yet when I issue a diff from the command line the return code is -ne 1.
I am guessing diff always writes to stdout???
Is there away I can force the difff to write to stderr USING THE CURRENT
template. If possible, I... (5 Replies)
Discussion started by: BeefStu
5 Replies
5. Shell Programming and Scripting
#!/bin/sh
exec 0</dev/null
exec 1>/dev/null
ls -l /proc/self/fd >&2 produces total 0
lr-x------ 1 tyler users 64 Feb 18 10:38 0 -> /proc/7886/fd
lrwx------ 1 tyler users 64 Feb 18 10:38 1 -> /dev/pts/4
lrwx------ 1 tyler users 64 Feb 18 10:38 2 -> /dev/pts/4 I've verified the shell is... (10 Replies)
Discussion started by: Corona688
10 Replies
6. Shell Programming and Scripting
I have been doing this:
make xyz &> xyz.log &; tail -f xyz.log
The problem with this is that you never can ge sure when "make xyz" is done.
How can I pipe both stderr and stdout into tee so both stderr and stdout are copied both to the display and to the log file?
Thanks,
Siegfried (3 Replies)
Discussion started by: siegfried
3 Replies
7. Programming
Hi all
I've run into a snag in a program of mine where part of what I entered in at the start of run-time, instead of the current value within printf() is being printed out.
After failing with fflush() and setbuf(), I tried the following approach
void BufferFlusher()
{
int in=0;... (9 Replies)
Discussion started by: JamesGoh
9 Replies
8. Shell Programming and Scripting
#!/usr/bin/perl
open(STDOUT, ">>$Textfile")
open(STDERR, ">>$Textfile")
print "program running\n";
$final = join("+", $initial,$final) #5
close (STDOUT);
close (STDERR);Hi all, above is my perl code. Notice i have captured the stdout and stderr to the same textfile. my code is expected to... (1 Reply)
Discussion started by: new2ss
1 Replies
9. Shell Programming and Scripting
How can I redirect and append stdout and stderr to a file when using cron? Here is my crontab file:
*/5 * * * * /dir/php /dir/process_fns.php >>& /dir/dump.txt
Cron gives me an 'unexpected character found in line' when trying to add my crontab file.
Regards,
Zach Curtis
POPULUS (8 Replies)
Discussion started by: zcurtis
8 Replies