Douglas,
 I "like" the idea that one can customize their computer to do whatever.

However, you have the problem:
 what happens when you have to use someone else's computer. Most likely 
  they will have bash as the default shell, and ~ will work in the way you 
  dislike

 When someone else uses your computer - they will complain that the ~ 
  symbol don't work.

I would have thought that using \~ will get most circumstances.


Derek.

==========================================================================
 On Fri, 7 Dec 2007, Douglas Royds wrote:

> It has irritated me for some time that Bash was expanding ~ (my home directory
> path). For instance, if I type:
> 
>    $ ls ~/Doc <Tab>
> 
> Bash would expand the path to:
> 
>    $ ls /home/roydsd/Documents
> 
> This is a matter of personal taste, but I'd prefer the tilde to remain,
> thanks.
> 
> I've found the culprit in /etc/bash_completion. Find the function _expand(),
> and edit it as follows:
> 
>    # This function expands tildes in pathnames
>    #
>    _expand()
>    {
>        [ "$cur" != "${cur%\\}" ] && cur="$cur\\"
> 
>        # expand ~username type directory specifications
>        if [[ "$cur" == \~*/* ]]; then
>            #eval cur=$cur <-------- Commented out
>            return # <-------- Added
>           
>        elif [[ "$cur" == \~* ]]; then
>            #cur=${cur#\~}  <-------- Commented out
>            #COMPREPLY=( $( compgen -P '~' -u $cur ) )  <--------
>    Commented out
>            #return [EMAIL PROTECTED]  <-------- Commented out
>            return # <-------- Added
>        fi
>    }
> 
> Douglas.
> 
> 
> 
> 
> 
> =======================================================================
> This email, including any attachments, is only for the intended
> addressee.  It is subject to copyright, is confidential and may be
> the subject of legal or other privilege, none of which is waived or
> lost by reason of this transmission.
> If the receiver is not the intended addressee, please accept our
> apologies, notify us by return, delete all copies and perform no
> other act on the email.
> Unfortunately, we cannot warrant that the email has not been
> altered or corrupted during transmission.
> =======================================================================
> 
> 

-- 
Derek Smithies Ph.D.
IndraNet Technologies Ltd.
Email: [EMAIL PROTECTED]
ph +64 3 365 6485
Web: http://www.indranet-technologies.com/

Reply via email to