Simple Question? The 'DOT' in a shell script test
I was looking at this line in an init file:
Code:
test -f /etc/default/postfix && . /etc/default/postfix First, There was no action associated with the line at all - so regardless of the result of the test, it appears to be superfluous - unless.... I noted the period/dot just after the && and I don't honestly know what it means in this context. Google would be the first port of call, but searching for '.' is notorious. The best I could find was 'run in the same shell' but I can't make the connection in my brain of where this fits in to the context of the test. Can anyone put me out of my misery? |
The statement reads, if /etc/default/postfix exists, then source /etc/default/postfix.
The '.' means source the file. That is, make the contents of the file part of the current environment. Usually the file will contain functions and/or variables that are set. |
I never knew that! You've given me a much needed pointer to find out more. Really appreciate it - thanks for your time and response.
|
All times are GMT -5. The time now is 12:55 AM. |