problem in cd in bash (maybe an RFE);

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

problem in cd in bash (maybe an RFE);

L A Walsh
In Bash Ver 4.4.5, cdspell is confused by non-directory
items in the same dir.


>  uname -a
Linux Ishtar 4.10.8-Isht-Van #4 SMP PREEMPT Thu Apr 20 10:46:50 PDT 2017
x86_64 GNU/Linux

>  set -o|grep on|sed -r 's/[      ].*$//'|tr "\n" " "   # (set -o "on"
vals)
braceexpand hashall history interactive-comments monitor onecmd pipefail vi


>  shopt -s|sed -r 's/[    ].*$//'|tr "\n" " "       # (shopts that are on)
autocd cdable_vars cdspell checkhash checkwinsize cmdhist
complete_fullquote dirspell dotglob expand_aliases extglob extquote
force_fignore globasciiranges globstar histappend histreedit histverify
hostcomplete interactive_comments lithist login_shell
no_empty_cmd_completion nocaseglob nocasematch progcomp promptvars
sourcepath xpg_echo


 

Ex1
1   Ishtar:law/mail> cd _archive/re
2   Records/   record*
3   Ishtar:law/mail> cd _archive/rec<tab>
4   Records/   record
5   Ishtar:law/mail> cd _archive/record<tab>
6   Records/   record
7   Ishtar:law/mail> cd _archive/records<CR>   # add 's' & hit return
8   -bash: cd: _archive/records: Not a directory

If I change record -> records.tmp, it works:

Ex2
1   Ishtar:law/mail> cd _archive/re<tab>
2   Records/     records.tmp
3   Ishtar:law/mail> cd _archive/records<CR>
4   _archive/Records
5   Ishtar:law/mail/_archive/Records>

If I add '*' it works:

Ex3 (continuing from Ex1#8, above):
1   Ishtar:law/mail> cd _archive/records*<CR>
2   Ishtar:law/mail/_archive/Records>

---
I'm guessing Ex3 works due to the 'nocaseglob' (?).

Ex2 seems to work due to cdspell (?).

So why does Ex1 fail?  Could it be made to work w/o
"fruity-side dishes"? (crazy/wacky side effects)  :-)

Thanks!
-l




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problem in cd in bash (maybe an RFE);

Chet Ramey
On 7/17/17 8:31 PM, L A Walsh wrote:

> In Bash Ver 4.4.5, cdspell is confused by non-directory
> items in the same dir.
>
>
>>  uname -a
> Linux Ishtar 4.10.8-Isht-Van #4 SMP PREEMPT Thu Apr 20 10:46:50 PDT 2017
> x86_64 GNU/Linux
>
>>  set -o|grep on|sed -r 's/[      ].*$//'|tr "\n" " "   # (set -o "on"
> vals) braceexpand hashall history interactive-comments monitor onecmd
> pipefail vi
>
>
>>  shopt -s|sed -r 's/[    ].*$//'|tr "\n" " "       # (shopts that are on)
> autocd cdable_vars cdspell checkhash checkwinsize cmdhist
> complete_fullquote dirspell dotglob expand_aliases extglob extquote
> force_fignore globasciiranges globstar histappend histreedit histverify
> hostcomplete interactive_comments lithist login_shell
> no_empty_cmd_completion nocaseglob nocasematch progcomp promptvars
> sourcepath xpg_echo
>
>
>
>
> Ex1
> 1   Ishtar:law/mail> cd _archive/re
> 2   Records/   record*
> 3   Ishtar:law/mail> cd _archive/rec<tab>
> 4   Records/   record 5   Ishtar:law/mail> cd _archive/record<tab>
> 6   Records/   record 7   Ishtar:law/mail> cd _archive/records<CR>   # add
> 's' & hit return
> 8   -bash: cd: _archive/records: Not a directory

> So why does Ex1 fail?  Could it be made to work w/o
> "fruity-side dishes"? (crazy/wacky side effects)  :-)

I can't reproduce this; I think you'd probably get different results if
you turned off programmable completion.


--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    [hidden email]    http://cnswww.cns.cwru.edu/~chet/

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problem in cd in bash (maybe an RFE);

L A Walsh


Chet Ramey wrote:
> I can't reproduce this; I think you'd probably get different results if
> you turned off programmable completion.
>  
----
tested with: shopt -u progcomp

"Problem" no longer reproducible.  Seems some completion "stuff"
(pkg, orphan or distro change) seems to be at fault.


Thanks & sorry for bother,
-linda




Loading...