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:
parent
acd84a2a4c
commit
8ded734477
5 changed files with 36 additions and 10 deletions
|
|
@ -117,6 +117,13 @@
|
|||
(expect "jobs in a pipe, without jobs" (c "jobs | n") "0")
|
||||
(expect "history in a pipe, without an editor" (c "history | n") "0")
|
||||
|
||||
;; echo.
|
||||
(expect "echo is a value command" (c "type echo") "echo is a value command: echo, echo")
|
||||
(expect "echo: its words as one string" (c "echo a b | n") "1")
|
||||
(expect "echo with no words" (c "echo | wc -c") "1")
|
||||
(expect "echo -n is the program" (c "echo -n x | wc -c") "1")
|
||||
(expect "echo > a file" (c "echo hi > e.txt; cat e.txt") "hi")
|
||||
|
||||
;; Names (decision 4).
|
||||
(expect "a long name that is a program runs the program" (c "printf 'a\\na\\n' | uniq -c") " 2 a")
|
||||
(expect "a short name is always the value command" (c "type u") "u is a value command: uniq, u")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue