blinksh / blinksh/blink

The `>>` operator should append output to file

Open
#829 0 comments 4 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
6.9k
Forks
746
PR merge metrics
No merged PRs in 30d

Description

## The problem

If you try to use the `>>` append redirector in the REPL, you instead get the `>` create/replace redirector to a file _named_ `>`.

## Expected behavior

```
blink> echo '# My document' > letter.md
blink> cat letter.md
# My document
blink> echo 'The first non-headline line of my document.' >> letter.md
blink> cat letter.md
# My document
The first non-headline line of my document.
blink>
```

## Actual behavior

```
blink> echo '# My document' > letter.md
blink> cat letter.md
# My document
blink> echo 'The first non-headline line of my document.' >> letter.md
blink> cat letter.md
# My document
blink> ls -lt | head
total 652592
-rw-r--r-- 1 mobile mobile 44 Oct 13 2019 >
-rw-r--r-- 1 mobile mobile 14 Oct 13 2019 letter.md
```

[...8 lines deleted...]

```
blink> cat '>'
The first non-headline line of my document.
blink> rm '>'
blink>
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue in the Blink REPL using the `>` and `>>` commands shown, then trace the REPL's redirector handling. The fix is done when `>>` appends to the existing `letter.md` instead of creating a file named `>`, while `cat letter.md` shows both lines.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell, swift
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.