kguzek / kguzek/kash

filename parsing for redirection target

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

The redirection detection happens before tokenization, which means that filenames are read literally.

These do not work as expected:

1. `command > file ` (literally writes to `file `, with the trailing spaces in the filename)
2. `command > 'file name'` (literally writes to `'file name'`, with the single quotes)

Basically all input parsing is omitted. This is a challenge to combine redirection with parsing because redirection can be separate words (with spaces before or around the redirection operator), or as one word. The tokenizer will probably have to be extended to explicitly support redirection operators.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the redirection detection and tokenizer code, then reproduce the two examples in the issue. Trace how redirection targets are separated from command words, including operators with surrounding spaces and operators attached to a word; done means trailing spaces and quotes are parsed correctly in both examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, shell
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.