implemented 'type' and 'wait' builtins

fixed some tcsetpgrp() misbehavior

fixed not being able to redirect stderr from builtins
This commit is contained in:
2026-03-01 17:14:48 -05:00
parent 84aed128d6
commit 2ea44c55e9
38 changed files with 922 additions and 635 deletions

View File

@@ -1,14 +1,11 @@
use crate::{
jobs::JobBldr,
libsh::error::{ShErr, ShErrKind, ShResult},
parse::{NdRule, Node},
parse::{NdRule, Node, execute::prepare_argv},
prelude::*,
state::{self, source_file},
};
use super::setup_builtin;
pub fn source(node: Node, job: &mut JobBldr) -> ShResult<()> {
pub fn source(node: Node) -> ShResult<()> {
let NdRule::Command {
assignments: _,
argv,
@@ -17,8 +14,8 @@ pub fn source(node: Node, job: &mut JobBldr) -> ShResult<()> {
unreachable!()
};
let (argv, _) = setup_builtin(Some(argv), job, None)?;
let argv = argv.unwrap();
let mut argv = prepare_argv(argv)?;
if !argv.is_empty() { argv.remove(0); }
for (arg, span) in argv {
let path = PathBuf::from(arg);