Synopsis
eval: eval [arg ...]
Description
eval takes its arguments, concatenates them separated by spaces, and executes the resulting string as Bash code in the current execution environment. eval in Bash works in essentially the same way as most other languages that have an eval function.
Synopsis
eval: eval [arg ...]
Description
eval takes its arguments, concatenates them separated by spaces, and executes the resulting string as Bash code in the current execution environment. eval in Bash works in essentially the same way as most other languages that have an eval function.
Synopsis
eval: eval [arg ...]
Description
eval takes its arguments, concatenates them separated by spaces, and executes the resulting string as Bash code in the current execution environment. eval in Bash works in essentially the same way as most other languages that have an eval function.
Synopsis
eval: eval [arg ...]
Description
eval takes its arguments, concatenates them, and executes the resulting string as Bash code in the current execution environment. eval in Bash works in essentially the same way as most other languages that have an eval function.
Synopsis
eval: eval [arg ...]
Description
eval takes its arguments, concatenates them, and executes the resulting string as Bash code in the current execution environment. eval in Bash works in essentially the same way as most other languages that have an eval function.
Synopsis
eval: eval [arg ...]
Description
eval takes its arguments, concatenates them, and executes the resulting string as Bash code in the current execution environment. eval in Bash works in essentially the same way as most other languages that have an eval function.
Synopsis
eval: eval [arg ...]
Description
eval takes its arguments, concatenates them, and executes the resulting string as Bash code in the current execution environment. eval in Bash works in essentially the same way as most other languages that have an eval function.
How Does eval Work?
Part of the problem with eval is that most of us don't have a clear picture of how it works.
In a nutshell, eval concatenates all of the arguments its given into a space-delimited string, assumes it is a valid command with arguments and tries to execute it, returning the result in place of the command...
$ A=1; B='$A'; echo $B
$A
$ A=1; B='$A'; eval echo $B
1
How Does eval Work?
Part of the problem with eval is that most of us don't have a clear picture of how it works.
In a nutshell, eval concatenates all of the arguments its given into a space-delimited string, assumes it is a valid command with arguments and tries to execute it, returning the result in place of the command...
$ A=1; B='$A'; echo $B
$A
$ A=1; B='$A'; eval echo $B
1