I'm trying to add a boot script to /etc/profile.local that will export a global environment variable. I need to check the existence of and contents of 2 files. If the first file exists and has an entry, then use that entry plus two characters for the value of the environment variable. If the first file is empty or missing then I need to get the value from the second file and use that plus the two characters if that file exists. If neither file exists or both are empty then a default gets exported.
I can read a file into a variable and export it like this
Code: Select all
#export MY_VARIABLE=$(<$file)-x
#echo $MY_VARIABLE
mydata-x
Help please?
Regards,
Mobeus