On 13 Bøe, 15:13, luciosan <lucio...@gmail.com> wrote:
> Hi
>
> How can I redirect stout and sterror in a file and only sterror
> inanother file at the same time?
>
> For example, If I run the script:
> /script.sh >> log.txt 2>&1
>
> It will write in "log.txt" stout and sterror.
>
> But, If I want write stout and sterror in "log.txt" and at the
> sametime sterror in "error.log", it's possible?
>
> Thank you.
>
> --
> I'm using an evaluation license of nemo since 203 days.
> You should really try it!http://www.malcom-mac.com/nemo
Well, this is not a good solution, but it is a solution of your
problem I think...
./script.sh 2>&1 >log.txt | ./two_files_logger "log.txt" "error.log"
where two_files_logger is script like this:
#!/bin/bash
while read line ; do
echo $line >> $1
echo $line >> $2
done
I am pretty sure that there are many better, faster and "all-in-one-
script" solutions but that is what i would do...