I'm using a central location for my bashrc and source that for all my users like this:
GLOBAL_BASHRC="/path/to/global/bashrc"
if [ -r "$GLOBAL_BASHRC" -a -f "$GLOBAL_BASHRC" ]; then
# Load the bashrc
source $GLOBAL_BASHRC
else
echo "Warning: Bashrc file [${GLOBAL_BASHRC}] does not exist!"
fi
And now I want to do the same thing for my inputrc file. I already found out how to do the equivalent to source in inputrc from this question:
$include /path/to/global/inputrc
But the thing is, like in the bashrc above I want some error handling, I only want to load the file if it actually exists. Therefore my question is, how do I specify an if statement checking if a file exists in my inputrc?