implemented '<>' redirects, and the 'seek' builtin

'seek' is a wrapper around the lseek() syscall

added noclobber to core shopts and implemented '>|' redirection syntax

properly implemented fd close syntax

fixed saved fds being leaked into exec'd programs
This commit is contained in:
2026-03-14 20:04:20 -04:00
parent 5173e1908d
commit 9bd9c66b92
11 changed files with 576 additions and 162 deletions

View File

@@ -201,6 +201,7 @@ impl ShErr {
pub fn is_flow_control(&self) -> bool {
self.kind.is_flow_control()
}
/// Promotes a shell error from a simple error to an error that blames a span
pub fn promote(mut self, span: Span) -> Self {
if self.notes.is_empty() {
return self;
@@ -208,7 +209,9 @@ impl ShErr {
let first = self.notes[0].clone();
if self.notes.len() > 1 {
self.notes = self.notes[1..].to_vec();
}
} else {
self.notes = vec![];
}
self.labeled(span, first)
}