10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I know that
mmmmm 2> error.txt
will send the error message to the specified file instead of the screen. However, I have seen
>&2
in some scripts, and I can't get it to do anything. A source said it sends stdout and stderr to a file. What file?
Ubuntu 18.04.2; Xfce 4.12.3;... (11 Replies)
Discussion started by: Xubuntu56
11 Replies
2. Shell Programming and Scripting
Hello All,
I have a requirement to redirect stdout and stderr to 'log' file and stderr alone to 'err' file.
Can someone please help me with this?
Thanks in advance (2 Replies)
Discussion started by: vikas_trl
2 Replies
3. Shell Programming and Scripting
I have to redirect STDERR messages both to screen and also capture the same in a file but STDOUT only to the same file.
I have searched in this formum for a solution, but something like
srcipt 3>&1 >&2 2>&3 3>&- | tee errs
doesn't work for me...
Has anyone an idea??? (18 Replies)
Discussion started by: thuranga
18 Replies
4. Shell Programming and Scripting
Hi All,
I need to redirect screen o/p of shell script to file , but I don't want to use "tee" :Dcommand
./test.sh 2>&1 | tee /var/tmp/testing`date +'%d%h%Y%T'`.log
but I want to write some code inside the shell script itself so wen I execute
./test.sh
it will display o/p in screen... (3 Replies)
Discussion started by: tarunn.dubeyy
3 Replies
5. Shell Programming and Scripting
Hi All,
Solarix/Bash v3x
Im trying to output any standard errors created by the script to a file using the below command:
. runDTE.sh 2> "$DTE_ERROR_FILE"
however the errors do get written to the dir/file stored in $DTE_ERROR_FILE but the error does not appear on the terminal screen in... (4 Replies)
Discussion started by: satnamx
4 Replies
6. Shell Programming and Scripting
I am trying to redirect the output from stderr to a log file from within a bash script. the script is to long to add 2> $logfile to the end of each command. I have been trying to do it with the command exec 2> $logfile This mostly works. Unfortunately, when a read command requires that anything be... (5 Replies)
Discussion started by: vockleya
5 Replies
7. 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
8. Shell Programming and Scripting
% ls -ld /usr /foo
ls: /foo: No such file or directory
drwxr-xr-x 14 root wheel 512 May 18 02:49 /usr
% ls -ld /usr /foo 1>/dev/null/
/dev/null/: Not a directory.
% ls -ld /usr /foo 2>/dev/null/
/dev/null/: Not a directory.
^^Why why why doesn't this work for me. Furthermore, where is... (7 Replies)
Discussion started by: phpfreak
7 Replies
9. Shell Programming and Scripting
Friends
I have to redirect STDERR messages both to screen and also capture the same in a file.
2 > &1 | tee file works but it also displays the non error messages to file, while i only need error messages.
Can anyone help?? (10 Replies)
Discussion started by: vikashtulsiyan
10 Replies
10. Shell Programming and Scripting
If I forget to set up stderr redirection on execution of a script, is there a way to set that redirection post-exec? In other words, if I have a script running and no errors are being logged... and then I remember that I forgot the 2>&1 on the script... can I turn it on after the fact?
...and... (1 Reply)
Discussion started by: jjinno
1 Replies