Various additions and improvements

This commit is contained in:
2025-03-15 21:04:45 -04:00
parent 7f21e5baa7
commit 505b968c60
31 changed files with 1421 additions and 341 deletions

View File

@@ -15,9 +15,7 @@ pub fn echo(node: Node, io_stack: &mut IoStack, job: &mut JobBldr) -> ShResult<(
let child = ChildProc::new(Pid::this(), Some("echo"), Some(child_pgid))?;
job.push_child(child);
for redir in node.redirs {
io_stack.push_to_frame(redir);
}
io_stack.append_to_frame(node.redirs);
let mut io_frame = io_stack.pop_frame();
io_frame.redirect()?;
@@ -26,6 +24,7 @@ pub fn echo(node: Node, io_stack: &mut IoStack, job: &mut JobBldr) -> ShResult<(
let mut echo_output = prepare_argv(argv)
.into_iter()
.map(|a| a.0) // Extract the String from the tuple of (String,Span)
.skip(1) // Skip 'echo'
.collect::<Vec<_>>()
.join(" ");