Bootstrap FreeKB - Linux Commands - eval
Linux Commands - eval

Updated:   |  Linux Commands articles

The eval command can be used to run a command stored in a variable. For example, let's say you have the following variable.

[john.doe@server1 ~]$ cdtmp="cd /tmp"

 

The eval command can then be used to issue the command stored in the variable. Notice that when the eval command is issued, this actually changes the directory to /tmp.

[john.doe@server1 ~]$ eval $cdtmp
[john.doe@server1 tmp]$

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter e3f8e0 in the box below so that we can be sure you are a human.