summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorianmacd <>2003-08-03 16:45:59 +0000
committerianmacd <>2003-08-03 16:45:59 +0000
commit7a4383333814e48bd039b5490cecaad3df9ebae1 (patch)
treec06041d4a8129dd646d107b69ad84b27eb625ab8 /README
parent66f191dfde6f6a0a3c820a41ddf275523fadc6c8 (diff)
downloadbash-completion-7a4383333814e48bd039b5490cecaad3df9ebae1.tar.gz
- add details of using /etc/profile.d and how to deal with MacOS X
Diffstat (limited to 'README')
-rw-r--r--README32
1 files changed, 28 insertions, 4 deletions
diff --git a/README b/README
index 7c83cea9..1b0444a4 100644
--- a/README
+++ b/README
@@ -1,12 +1,16 @@
-$Id: README,v 1.18 2003/04/21 10:00:03 ianmacd Exp $
+$Id: README,v 1.19 2003/08/03 18:45:59 ianmacd Exp $
INSTALLATION
------------
-If you are installing the source file manually as opposed to using a
-packaging system such as dpkg or rpm, put it somewhere on your system
-and source it from either /etc/bashrc or ~/.bashrc.
+The easiest way to install this software is to use a package, such as
+the RPM that I maintain for Red Hat Linux, the .deb package for
+Debian/GNU Linux, etc.
+
+If that's not an option or you simply don't want to do this, put the
+bash_completion file somewhere on your system and source it from either
+/etc/bashrc or ~/.bashrc.
Here's one possible way of doing that from /etc/bashrc:
@@ -26,6 +30,26 @@ using it is that it will also parse correctly when interpreted by bash
1.x. If you have bash 1.x and bash 2.x users on your system, you must
avoid using constructs that were not valid under 1.x syntax.
+If your system has an /etc/profile.d directory, you might instead want
+to add a script called bash_completion.sh to that directory. Add the
+above code, preceded by the following:
+
+# check for bash
+[ -z "$BASH_VERSION" ] && return
+
+In this case, all *.sh scripts in /etc/profile.d are sourced from
+/etc/bashrc by Bourne-like shells, so you need the extra check for bash
+in order to avoid sourcing the rest of the script if a shell other than
+bash is running.
+
+If you're using MacOS X, /etc/bashrc is apparently not sourced at all.
+In that case, you should put the bash_completion file in /sw/etc and add
+the following code to ~/.bash_profile:
+
+if [ -f /sw/etc/bash_completion ]; then
+ . /sw/etc/bash_completion
+fi
+
If you are putting the bash completion source file somewhere other
than /etc/bash_completion, you should ensure that $BASH_COMPLETION is
set to point to it before you source it. Your ~/.bashrc file is a good