unix linux shell script code snippet
Generating script logs with timestamp
Just as the duration of script it’s useful to have time-stampped log. Use following function to log time for every output.
Call the function as follows instead of simply “echo”ing.
Reading variables from config file
Create a config file with contents as follows:
Add following line in the beginning of the shell script:
This will load the key value pairs and you may verify & access the values as $key1 or $key2.
And if you get stuck… Ask Here
email me firstname.lastname@example.org