help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Shell Expansion


From: robivad
Subject: Shell Expansion
Date: Wed, 14 Apr 2021 10:58:58 +0200

Hi help-bash members,

I noticed that books and online manuals report two different orders for the
recognition and the execution of expansions.

https://www.gnu.org/software/bash/manual/bash.html#Shell-Expansions

[diagram from a book][1]
[1]: <https://i.stack.imgur.com/b79Hw.jpg>

Considering the following:
```
$(((5+2)))
7: command not found
```

1) I think that the shell first recognizes the command substitution and
then the arithmetic substitution.
2) shell executes first the arithmetic substitution and then the command
substitution

Is the order of parsing different from the order of execution or is the
order on the image wrong? Why $((((5+2)))) gives 7: command not found just
like $(((5+2))) ?

Roberto


reply via email to

[Prev in Thread] Current Thread [Next in Thread]