echo as a value command

- echo gives its words as one string, and shadows the program.
- With -n, -e or -E it runs the program echo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Linus Björnstam 2026-12-01 07:29:10 +01:00
parent acd84a2a4c
commit 8ded734477
5 changed files with 36 additions and 10 deletions

View file

@ -70,7 +70,7 @@
(expect ">FILE 2>&1" (c (str "ls /no/such/dir >" file " 2>&1; grep -c such " file)) "1")
(expect "2>&1 before >" (c (str "ls 2>&1 >" file))
"err: bjosh: 2>&1 before > or >> is not supported yet: write >FILE 2>&1\ncode: 2")
(expect ">&2 is not supported yet" (c "echo x >&2")
(expect ">&2 is not supported yet" (c "printf x >&2")
"err: bjosh: >&2 is not supported yet\ncode: 2")
;; Shell commands.