Comments (2)
Thanks for the report.
I'll probably end up doing the simple thing, but I'm asking in case you can see a "better" alternative. Outside of tee, this would normally be solved with pipes. Specifically, cvtvt -text
can be used to strip VT escapes. Unfortunately that doesn't work for tee, which is writing to a file directly and has no way to insert pipes into that stream.
So, considering that this is open source, there's a single repo that implements piping and execution that also has tee. It seems like it ought to be possible for tee to support pipes on the file stream, and the challenge is inventing a syntax to let it do so that doesn't create more problems than it solves.
Would it make sense to be able to do something like:
df | tee -c "cvtvt -text" file
?
Another option would be to optionally invert tee's behavior. Currently tee writes to a file (without pipe support), and writes to stdout (which can be further piped.) An inverted tee would write to the display (without pipe support) and write to stdout (which can be further piped, ultimately to a file.)
Part of the reason I'm asking is because I think there are other operations that make sense to perform on the file as well (eg. iconv.)
Of course, there may be other options too. Do you see any more generic/elegant approach to this aside from hardcoding one specific operation into tee?
from yori.
While I think the idea of having the double pipe sounds cool, to be able to pipe to cvtvt
first, I will have to leave that decision up to you because of effort needed.
I'm really new to using Yori, so I can't say right now how else I would use the new piping engine that would be required to do this for tee
As far as inverting tee
, that bothers me a bit as tee
in general is so well known, that it may be confusing to some, and no longer backwards compatible for existing users. If you did this, you would either need a new command to avoid confusion, or, a non-default set of switches that inverts the default behavior.
In some ways, I think your example of df | tee -c "cvtvt -text" file
makes the best sense if you are not going to simply "hardcode" the cvtvt
features into tee
.
Otherwise, it would probably be something like df | tee -c[onsole] | cvtvt -text file
, if you want to allow for an inverted tee (if that's even possible since they will both ultimately be going to the console).
from yori.
Related Issues (20)
- Ctrl-C stops working after terminating GUI app once HOT 5
- Provide all installer options as command line arguments HOT 2
- Allow for a custom starting directory HOT 2
- Command line length limit in Yori ? Like 8191 in cmd ? HOT 2
- Implement long path pseudo current directory HOT 4
- Broken alias command for paths with spaces HOT 2
- yori's lsof breaks react-scripts HOT 3
- Yori installer for the arm64 Windows HOT 4
- current version -- 2.0 is marked as infected with a trojan by Windows Defender HOT 3
- yenv: accept variable from stdin HOT 4
- "cab.exe -s -u" does not overwrite files with read-only and system attributes set HOT 2
- "ycopy.exe -p" raises ERRORLEVEL to 1 if there is nothing to overwrite HOT 1
- Can't run Notepad HOT 2
- YoriInit.ys1 script %__APPDIR__% and %__CD__% environment variables on Windows XP HOT 2
- throw er; // Unhandled 'error' event HOT 2
- fail to install yori-core on amd HOT 2
- ConEmu + Clink + Yori + Python + xonsh = surprise XD HOT 2
- CD Improvement HOT 2
- feature request: DIR /W multi-column filename-only view HOT 2
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 yori.