unix - I am having trouble understanding what ${@} means in KSH -
No Long Questions, What Does It Mean?
log message "file: $ {@}"
log-mail () is a method that logs a message with a timestamp.
But what does heck do
$ {@}
mean? I should also mention that there are $ 1 and $ 2 in the script too Google does not produce any results
f () {printf '% s' N' "file: $ @"; } "First argument" "second argument" will expand in "third argument"
and run the command:
printf '% s \ n' "file : The first argument "second argument" "third argument"
This means that your logic list ( $ 1
, $ 2 ,
$ 3
, etc.) arguments (not throwing any information provided by the user through the quote)
It is different from:
printf '% s \ n' file: $ @
or
printf '% s \ N' file: $ *
both of which are the same:
printf '% s \ N "" file: "" first "" logic "" second "" argument "" third "" argument "
... expand both the string segmentation and glob- logic list, So if the user has passed, then say, "*"
(inside the quotation marks to make it literally), without using it here, the character can be used as a globe Will change with the expansion to the results, however, viz. In addition to the list of files in the current directory, besides the other side effects of string-splitting, such as nullions or tabs are to be replaced.
This also differs from:
printf '% s \ n' 'file: $ * "
Which is similar:
printf '% s \ n' "file: first argument second logic third argument"
..., as you above
Comments
Post a Comment