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
Post a Comment