surtout que je ne sais pas bien comment faire!!!
Mais ce que j'ai vu par ailleurs me confirme dans cette certitude!
Maintenant, si tu me dis qu'on ne peut pas sans fifo (ce qui était ma question originelle), je veux bien l'admettre humblement!
Voici un embryon de solution:
http://stackoverflow.com/questions/3173131/redirect-copy-of-stdout-to-log-file-from-within-bash-script-itself
Code:
1 2 3 4 5 6 7 8
| PIPE=tmp.fifo
mkfifo $PIPE
exec >$PIPE
tee foo.log <$PIPE &
# rest of your script
rm $PIPE |
ou bien, vu sur
http://stackoverflow.com/questions/2...iple-files-tee
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| OUTPUT_LOG=output.log
OUTPUT_PIPE=output.pipe
rm -f $OUTPUT_PIPE
mkfifo $OUTPUT_PIPE
rm -f $OUTPUT_LOG
tee $OUTPUT_LOG < $OUTPUT_PIPE &
tpid=$!
exec 3>&1 4>&2 >$OUTPUT_PIPE 2>&1
echo "This is on standard out"
echo "This is on standard err" >&2
exec 1>&3 3>&- 2>&4 4>&-
wait $tpid
rm -f $OUTPUT_PIPE |