emersion / emersion/mrsh

read does not seem to split input fields according to a given variable list

Open
#155 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
531
Forks
40
PR merge metrics
No merged PRs in 30d

Description

For a given script such as:

```sh
printf 'a b\n' | while read -r field1 field2; do
printf '[%s]\n' "$field1" "$field2"
done
```

I would expect the following output:

```
[a]
[b]
```

However with `mrsh` this is printed instead:

```
[a b]
[]
```

I wasn't able to find an open or closed issue regarding this so I'm unsure whether this is known issue.

*PS: mrsh also seems to block on `read` when used in a while loop reading from a redirected file, such as `while read -r ...; do ...; done < file`. Should I make an issue for this too?*

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.