Results 1 to 3 of 3
hello
I wrote a backup-script with a lot of tests and outputs before and after the backup with rsync...
I want to write to stdout (this is normal) and to ...
- 08-10-2007 #1Just Joined!
- Join Date
- Aug 2007
- Posts
- 28
write a copy of stdout to a file, but with a read-command inside...
hello
I wrote a backup-script with a lot of tests and outputs before and after the backup with rsync...
I want to write to stdout (this is normal) and to write the same output incl. stderr to a file... (the whole output of the script, not only from one command).
And, there is also a bigger problem, I have at the beginning a read-command, the logfile don't must have the input, but should wait and after the input of the user it should do the job of logging further...
I googled a lot and read a lot of manpages (pipes, tee, ...) but, there is allways only one command or, then without a read inside the script...
This should be possible, I'm right?
Thanks for any help..
raphael
- 08-10-2007 #2
I don't understand why the read complicates matters. The prompt will appear in the logfile, and the inputted text will not be. And then it will continue.
The bigger problem will be dealing with stderr. Because piping only pipes stdout, you will need to merge stderr into stdout:
Is there something I'm missing here?Code:backup_script 2>&1 | tee logfile
DISTRO=Arch
Registered Linux User #388732
- 08-10-2007 #3Just Joined!
- Join Date
- Aug 2007
- Posts
- 28
yes, you are right, it works! Thanks a lot! Now, I run a first script which one start the next with tee... etc...
Thank you!
Greetings, Raphael


Reply With Quote