Wednesday, September 29, 2010

Period 3 Days Late Stomach Flu

BASH: assigning the output of a command to a variable

could not be easier, if you know how to do it:
 var = `command` 
(the symbol ` is not just a peak and is obtained by combining AltGr + ').
Or
 var = $ (command) 
And here's an example:
 chown `whoami`: `whoami` file.pdf 

chown $ (whoami): $ (whoami) file.pdf

0 comments:

Post a Comment