It is just string assignment
So subcommand is not executed in this line's timing
echo_random_command_as_string='echo $((RANDOM))'
When not use eval, just echo string
$echo_random_command_as_string # $((RANDOM))
Eval : execute command from string
These lines execute echo $((RANDOM))
everytime
eval $echo_random_command_as_string # e.g 76811 : randomized every time
eval $echo_random_command_as_string # e.g 345 : randomized every time
eval $echo_random_command_as_string # e.g 6532 : randomized every time
This is a wrong case ( not exepected result )
Subcommand is executed immediately when assignment
So variable got fixed string like 'echo 3457'
echo_random_fixed="echo $((RANDOM))"
$echo_random_fixed # e.g 3457 : not randomized every time
$echo_random_fixed # e.g 3457 : not randomized every time
$echo_random_fixed # e.g 3457 : not randomized every time