Added @Bwoe's fix for non-interactive bash shells