Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 2508

Raspberry Pi OS • Re: Reading the Content of a File to a Variable

$
0
0
Go old school?

Code:

export MachineID=`cat DeviceName.txt`
Though that's eseential just a different way of writing the same thing.

Incidentally, I'd expect problems with that if the cwd is not as expected when the command executes.

Statistics: Posted by thagrol — Fri Aug 30, 2024 3:32 pm



Viewing all articles
Browse latest Browse all 2508

Trending Articles