Comments (4)
First of all, gnu tee also has the same behaviour and since the wtee is
analogue of tee this is not an real issue for wtee. Moreover, I've been
struggling with the same problem you described and finally found out that it is
the pipe which is responsible on windows platform which prevents from passing
exit status. There, actually, workaround solutions with reading exit status
before piping and saving it for further utilization. Anyway, this is not a tee
who responsible for inability to pass pass exit status. If you have different
opinion, please let me know.
Pavel
Original comment by [email protected]
on 12 Dec 2010 at 8:47
from wintee.
Could you please pass more information about the issue with windows ?
Any idea how we could workaround it ?
Even on the WinApi level.
Thanks!
Original comment by pavel.savara
on 8 Nov 2011 at 3:23
from wintee.
Gnu tee does also have the same issue, but there are workarounds on *nix (see
http://lists.samba.org/archive/linux/2004-March/010158.html and its links).
Unfortunately, there don't seem to be documented workarounds for use on
windows. I am using GnuWin32's tee
(http://gnuwin32.sourceforge.net/packages/coreutils.htm and elsewhere) and had
to quit because I need to check the return code of the command I am teeing. So
how can we use tee on windows and still check return codes?
Original comment by [email protected]
on 6 Jun 2012 at 7:58
from wintee.
In case someone still stumbles over this:
I had the same issue and tried several tee for Windows and workarounds.
Only solution I found is to run the command in powershell. There you have a tee
and errorlevel/exit code is retained. Can also be passed to the batch file from
which you called it from (if you leave the rest in a batch file).
Example powershell script:
<mycommand> 2>&1 | tee logs/mylogfilename_$(get-date -f dd.MM.yyyy_HH-mm-ss).log
exit $LastExitCode
Original comment by [email protected]
on 16 Apr 2014 at 2:09
from wintee.
Related Issues (15)
- Color command is lost
- Exits with error if no console (stdout) is present HOT 1
- end of non-empty target file does not get overwritten
- output rarely gets displayed when small amount is generated HOT 1
- File overwrite can leave stale information at the end of the file
- Does not compile out-of-the-box under Visual C++
- Windows Command Line - %date:~x,y% not working, lost
- Extra character at beginning of both standard out and file HOT 4
- Option to suppress output to stdout HOT 2
- stdout to file aswell HOT 2
- No result when used with cgrep
- showing progress through wtee
- <crtl>+<c> --> strange output, -i crashing HOT 1
- Piping to wtee will make all batch variables local.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wintee.