The current grep line grep -c "^[[:space:]]*source\|\. /etc/profile(\.d/autojump\.bash)[[:space:]]*$
will test positive for the following lines:
- source /dummy/file
- source
- . /etc/profile
It will fail for the following lines:
- . /etc/profile.d/autojump.bash
source\|\.
isn't grouped properly, and grouping parentheses need to be escaped with a slash.
I only tested on Ubuntu 10.10 server, but also changed OS X's grep line.