--- Dan McGhee <[EMAIL PROTECTED]> wrote: > On Wed, Sep 07, 2005 at 06:30:58AM -0700, Dan Nicholson wrote: > > >The config files are in /etc/X11/xdm. Xsession even has scripting to > >source profile and ~./bash_profile. > > Should I play it really safe and put a test in? > > if [ -f /etc/profile ]; then > source /etc/profile > fi
I think this type of test is overused; I see it in other scripts also. The single line 'source /etc/profile' works just fine: if /etc/profile exists and is readable, 'source /etc/profile' does just what you expect. If, for some reason, the file doesn't exist or is not readable, 'source /etc/profile' will produce an error message, which again is probably what you want. Basically the 'source' instruction already does the test for you, so you don't need to double the work. __________________________________ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com -- http://linuxfromscratch.org/mailman/listinfo/blfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page