ora=`/bin/date +%H:%M`
accento grave, oppure solo nella bash
ora=$(/bin/date +%H:%M)
Mario Vanoni
scusa Mario, confermi la cosa? io ricordo di aver usato più volte la sintassi VARIABILE=$(comando) anche in ash e di non aver trovato intoppi... questo è confermato anche qui, riporto un estratto:
Command Substitution
Ash accepts two syntaxes for command substitution:
`list`
and
$(list)
Either of these may be included in a word. During the
command substitution process, the command (syntactly a
list) will be executed and anything that the command
writes to the standard output will be captured by the
shell. The final newline (if any) of the output will be
deleted; the rest of the output will be substituted for
the command in the word.
questo significherebbe che neppure la ash è effettivamente un clone esatto della vecchia sh! io invece ero convinto che fosse così!
e comunque, clone esatto o meno: quale delle due espressioni e stringentemente POSIX? la prima oppure entrambe?
grazie,
M
