Timeline for Bash interpreting a variable assignment as a command
Current License: CC BY-SA 4.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Sep 8, 2021 at 19:42 | comment | added | Doktor J |
If you're going to recommend eval, you need to go into the pitfalls and dangers of doing such (some of which @Kusalananda pointed out). eval has its place, but it's a very precarious one.
|
|
| Aug 24, 2021 at 21:25 | comment | added | Kusalananda♦ |
If the commands read from the file is only ever so slightly more complex, this may break or generate unexpected results. You need to quote $varBar as well as make sure that the code read from the file is valid and correctly quoted shell code. Try with the command cd /; printf '*\t%s\n' * in the input data.
|
|
| Aug 24, 2021 at 21:06 | review | Low quality posts | |||
| Sep 8, 2021 at 19:42 | |||||
| Aug 24, 2021 at 20:41 | history | answered | waltinator | CC BY-SA 4.0 |