Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've been reading the doc I wrote about file handle redirections in the shell and they were associated with the thin arrow
->
(pipes) instead of the fat arrow=>
(redirections).While I was fixing that I noticed that I didn't have a use for a
<
shortcut because>
was used for thin arrows instead of fat arrows. Fat arrows can be written in both directions, so it'd make more sens to have both shortcuts for them, like in Unix. And then|
became really tempting as a shortcut for the thin arrow, like in Unix. I resisted that in the past, instead preferring to use it for the or-combinator. If I use the keywordor
for the or-combinator (or even||
as in Unix) then|
is free for the pipe shortcut...We'll see, but now
>
will stand for=>
and<
for<=
.While I was doing that I also revisited the decision in #387 to have
=>
appending to files, instead I made it truncate first as it was before and added=>>
which can be shortened to>>
... like in Unix. It's really useful to have both append and truncate in one command instead of having to usedelete
first for the latter. I was missing it while I tested the feature.In this PR I'm also adding a long syntax for file handles in redirections with the explicit
[1]=>
being equivalent to the implicit=>
while keeping the short1=>
that can now be even shorter with1>
, making it even shorter than in Unix.[1]=>[3]
will also be possible in the future.