bash - How to get a text file into variable? -


how can text file contents 01:23:45:67:89:ab variable $lastmac? tried few variations, cat not luck. tried use lastmac=$(cat lastmac.txt, tried use lastmac=`cat lastmac.txt' , there no error code, prompt shows blinking cursor, , nothing.

it did work. on next line, add:

echo $lastmac 

to see it.

by way, $( ) preferred on using quotes command substitution. if ever have nest command substitutions, you'll see why.


Comments

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -