Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elves/posixsh
Experimental POSIX shell implementation
https://github.com/elves/posixsh
Last synced: 2 months ago
JSON representation
Experimental POSIX shell implementation
- Host: GitHub
- URL: https://github.com/elves/posixsh
- Owner: elves
- License: bsd-2-clause
- Created: 2018-02-20T02:02:47.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-03T09:41:09.000Z (over 1 year ago)
- Last Synced: 2024-08-03T01:39:21.899Z (6 months ago)
- Language: Shell
- Size: 531 KB
- Stars: 7
- Watchers: 9
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This is xiaq's experimental POSIX shell. If it works out, it will eventually
to be integrated into [Elvish](https://github.com/elves/elvish).License is BSD 2-clause.
Files in `spec/oil` are derived from the
[Oil](https://github.com/oilshell/oil), licensed under Apache License 2.0. See
[spec/oil/LICENSE](spec/oil/LICENSE).## Status and limitations
The majority of POSIX shell features are implemented.
The following features are currently missing:
* [ ] Closing FDs in redirections (`<&-`, 2.7.5, 2.7.6)
* [ ] Background jobs and related features
* [ ] All of 2.9.3 "Async lists"
* [ ] `$!`
* [ ] `bg`
* [ ] `fg`
* [ ] `jobs`
* [ ] `wait`
* [ ] `set -o monitor` (`set -m`)
* [ ] `set -o notify` (`set -n`)
* [ ] `set -o errexit` (`set -e`)
* [ ] `set -o noexec` (`set -n`)
* [ ] `exec`
* [ ] `getopts`
* [ ] `hash`
* [ ] `$LINENO` (2.5.3)
* [ ] Signal handling
* [ ] All of 2.11 "Signals and error handling"
* [ ] `trap`
* [ ] Interactive features
* [ ] `$ENV` (2.5.3)
* [ ] `$PS1` (2.5.3)
* [ ] `$PS2` (2.5.3)
* [ ] `$PS4` (2.5.3)
* [ ] `fc`
* [ ] `set -o ignoreeof`
* [ ] `set -o nolog`.Some implemented features are incomplete:
- In `<<-` heredocs, leading tabs in expansions are not stripped (2.7.4). Example:
```sh
cat <<-EOF
$(echo '
bar')
EOF
```This should print an empty line followed by a line of just `bar`, but
currently this implementation has a tab before the `bar`.- Argument of variable expansions may not contain whitespaces (2.6.2). Example:
```sh
echo ${x=foo bar}
```This should print `foo bar` (with one space) and assign `$x` to `foo bar`
(with two spaces). This implementation treats this as a syntax error now.Since Go doesn't support `fork`, subshells are run in the same process, with
their own virtualized working directories and variables. This approach has some
inherent limitations:- Some properties cannot be virtualized: `ulimit`, `umask` and `exec` (when
implemented) will affect the entire process.- Code that actually depends on subshells running in separate processes won't
work correctly.The following features are out of scope and will likely never be implemented:
- `set -h`.
- `kill` and `newgrp` - both are widely available as standalone commands.
- Internationalization/localization. This includes support for `$LANG`, `$LC_*`
and `$NLSPATH`.