You are not logged in.

#1 2015-01-06 21:07:43

bfo
Member
Registered: 2009-11-27
Posts: 44

Bash completion fails only when using an alias

I have an alias defined in my '~/.bashrc':

alias pkgrm='sudo pacman -R'
> type pkgrm
pkgrm is aliased to `sudo pacman -R'

When I type 'pkgrm <tab>' I get an error:

/bin/ls: cannot access /var/sadm/pkg: No such file or directory

Nothing is wrong with the error message as this directory is in fact not there.
However, when I use the aliased command itself, everything works as expected:

> sudo pacman -R a<tab>
a52dec                acpid                 alsa-utils...

Could you shed some light on what's going on behind the scenes here?

Offline

#2 2015-01-06 21:40:14

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,546
Website

Re: Bash completion fails only when using an alias

Have you done something special to set up this completion?  I do not get package names from the competion just with `pacman -R`.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2015-01-06 21:49:06

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Bash completion fails only when using an alias

I've always had the same problem as the OP, just never got round to posting about it. A solution would make my systemctl aliases much more useful.

@Trilby, you need the bash-completion package installed.

Last edited by Slithery (2015-01-06 21:50:34)


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

Board footer

Powered by FluxBB