The question will attract opinions... The likely reasons for not liking `eval`: - scripters may not get quoting right, causing unintended behavior (think of the possibilities with unmatched quotes coming from a variable in the evaluation). - the result of the evaluation may not be obvious (partly from quoting problems, but partly because `eval` allows you to set variables based on other variables' names). On the other hand, if the data going into `eval` is checked, e.g., the results from testing filenames and ensuring there are no quotes to complicate things, then it is a useful tool. The alternatives usually suggested are less portable, e.g., specific to some particular shell implementation. Further reading (but bear in mind that bash offers implementation-specific/nonstandard alternatives): - [Why should eval be avoided in Bash, and what should I use instead?][1] - [What is the “eval” command in bash?][2] - [Unix/Linux Bash: Critical security hole uncovered][3] - [Writing Better Shell Scripts - Part 3][4] (see example with eval) - [Shell Script Security][5] (see example with eval) [1]: http://stackoverflow.com/questions/17529220/why-should-eval-be-avoided-in-bash-and-what-should-i-use-instead [2]: http://unix.stackexchange.com/questions/23111/what-is-the-eval-command-in-bash [3]: http://www.zdnet.com/article/unixlinux-bash-critical-security-hole-uncovered/ [4]: http://innovationsts.com/?p=2363 [5]: https://developer.apple.com/library/mac/documentation/OpenSource/Conceptual/ShellScripting/ShellScriptSecurity/ShellScriptSecurity.html