help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] How to create a real copy of file descriptors stdout / s


From: Patrick Schleizer
Subject: Re: [Help-bash] How to create a real copy of file descriptors stdout / stderr?
Date: Tue, 28 Feb 2017 14:28:00 +0000

The following worked for me.

echo "int isatty(int fd) { return 1; }" | gcc -O2 -fpic -shared -ldl -o
"$isatty_so_file" -xc -

LD_PRELOAD+=" $isatty_so_file

LD_PRELOAD="$LD_PRELOAD" apt-get "$@" 2>&1 | tee -a "$logfile"

gcc compilation on the fly seems crazy but was a worthwhile test.

Is there some pre-build command line tool isatty or shared object isatty.so?

For now, ending up using the following.

python -c 'import pty, sys; pty.spawn(sys.argv[1:])' \
   | apt-get "$@" 2>&1 \
   | tee -a "$logfile"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]