Re: Feature Request: LSPATH for filename completion.

2008-07-12 Thread Chet Ramey

Some Developer wrote:

Hello,

1. It may help if we could overload CDPATH (either as it is, or via a 
shopt for backward compatibility reasons) so that Filename Completion 
consults CDPATH also.


This is a perfect opportunity to use programmable completion.  Writing a
shell function that uses CDPATH (or any other variable you choose,
including LSPATH) should be fairly simple, and you can use it as the
completion function for any command you like.

Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://cnswww.cns.cwru.edu/~chet/




Re: shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied

2008-07-12 Thread Chet Ramey

[EMAIL PROTECTED] wrote:


LynnOS wrote:

[EMAIL PROTECTED] Linux-vserver:~# pwd
/root
[EMAIL PROTECTED] Linux-vserver:~# ls -ld /root
drwx--3 root root 4096 Jul  3 14:52 /root
[EMAIL PROTECTED] Linux-vserver:~# su lynn
*shell-init: error retrieving current directory: getcwd: cannot access
parent directories: Permission denied*
[EMAIL PROTECTED] Linux-vserver:/root$


This is not a bash problem.  You're in a directory which can be read and
searched only by root, and you're su'ing to another user.  That user
does not have permission to search the current directory, even to find
`..', so getcwd is going to fail.

You might be able to avoid the need for the getcwd call at startup by
exporting PWD, so the child shell can read it, but there aren't any
guarantees.

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://cnswww.cns.cwru.edu/~chet/