Handle '$@' and '$*' parameters

* geesh/word.scm (parameter-ref): Handle '$@' and '$*' parameters.
This commit is contained in:
Timothy Sample 2018-11-08 22:36:11 -05:00
parent e6347dc37f
commit eb4b8bb61b
1 changed files with 5 additions and 0 deletions

View File

@ -137,6 +137,11 @@ string, the separator is derived from @var{ifs} using
"Get the value of the variable or special parameter @var{name} in
@var{env}. If @var{name} is unset, return @code{#f}."
(match name
("@" `(<sh-at> ,(environment-arguments env)))
("*" (let* ((ifs (or (var-ref env "IFS")
(string #\space #\tab #\newline)))
(sep (argument-separator ifs)))
(string-join (environment-arguments env) sep)))
("?" (number->string (environment-status env)))
(_ (var-ref env name))))