Other shells also support a number of other options with exec and
some have special behaviour when calling exec with no arguments except
redirections.
This PR only supports the basic case of replacing the Shell process
(or LibShell host process) with the provided command.
Such errors are raised when SyntaxError nodes are executed, and are also
used for internal control flow.
The 'break' and 'continue' commands are currently only allowed inside
for loops, and outside function bodies.
This also adds a 'loop' keyword for infinite loops.
This builtin takes a bunch of strings, resolves them as globs (in the
current directory) and prints out the matching entries.
Its main use is to allow dynamic glob resolution:
```sh
glob "$whatever/*"
```
Fixes#4345.
This was done in 54b453b in the name of "fixing event loop processing in
subshells", but I do not see how a new PGID is supposed to affect the event
loop.
This seems to have been done by mistake, let's see if any tests fail
because of this.
Problem:
- Clang reports unused private member warning in the `Shell::Formatter`.
- Vector is not used in the `Shell::Formatter`.
Solution:
- Remove unused private member variable.
- Remove unused includes.
As Vector<T> will relocate objects to resize, we cannot assume that the
address of a specific LocalFrame will stay constant, or that the
reference will not be dangling to begin with.
Fixes an assertion that fires when a frame push causes the Vector to
reallocate.
This patchset allows a match expression to have a list of names for its
glob parts, which are assigned to the matched values in the body of the
match.
For example,
```sh
stuff=foobarblahblah/target_{1..30}
for $stuff {
match $it {
*/* as (dir sub) {
echo "doing things with $sub in $dir"
make -C $dir $sub # or whatever...
}
}
}
```
With this, match expressions are now significantly more powerful!
waitid() *may* be called many times if a job does not exit, so only
assert this fact when the job has in fact exited.
Also allows Background nodes to contain non-execute nodes.
This allows us to easily re-use history loading and saving in other
programs using Line::Editor, as well as implementing universally
recognized HISTCONTROL.
This adds support for (basic) brace expansions with the following
syntaxes:
- `{expr?,expr?,expr?,...}` which is directly equivalent to `(expr expr
expr ...)`, with the missing expressions replaced with an empty string
literal.
- `{expr..expr}` which is a new range expansion, with two modes:
- if both expressions are one unicode code point long, the range is
equivalent to the two code points and all code points between the
two (numerically).
- if both expressions are numeric, the range is equivalent to both
numbers, and all numbers between the two.
- otherwise, it is equivalent to `(expr expr)`.
Closes#3832.