Public Notes on
View Public Collections
Loading...
BashFAQ/050 - Greg's Wiki mywiki.wooledge.org
I'm trying to put a command in a variable, but the complex cases always fail! Variables hold data. Functions hold code. Don't put code inside variables! There are many situations in which people try to shove commands, or command arguments, into variables and then run them. Each case needs to be handled separately. For the simple case in bash, you can use an array to store arguments to pass to a command (similar to constructing a command using args only known at runtime, below): #code #bash #command #variable #array #pub
Show More