Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 99924

Summary: app-shells/bash-3.0.-r12 alias doesn't expand the first time
Product: Gentoo Linux Reporter: Albert Hopkins (RETIRED) <marduk>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Albert Hopkins (RETIRED) gentoo-dev 2005-07-22 10:26:59 UTC
Ok I didn't want to submit this because I swore it was something I was doing
wrong, but now I swear it's not something I'm doing wrong ;-)

For years I have had this alias:

alias cp='rsync'

And I use ssh with rsync.  This allows me to just:

cp file <host>:

Instead of rsync.  Nice shortcut.

This has worked for *years*

Recently, I've been getting this:

$ type -a cp
cp is aliased to `rsync'
cp is /usr/bin/cp
cp is /bin/cp

$ cp gentoo.py nuthatch.gentoo.org:
$ ls nuthatch.gentoo.org\:
nuthatch.gentoo.org:

In other words, it copies the file locally as if it's just calling /bin/cp.  But
this only happens the *first* time I try to do this.  If I then arrow up and run
the *exact same* 'cp' command, it then uses rsync.  WTF?!

The other weird thing is that this doesn't always happen.  Just sometimes.  I
can't even say for sure whether it's a bash problem or an rsync problem.

Please don't tell me not to use this alias (I've been using it forever) and
please don't tell me I'm crazy ;-)
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2005-07-22 11:10:07 UTC
Are you using bash-completion? If so, which version?
Comment 2 Albert Hopkins (RETIRED) gentoo-dev 2005-07-22 13:15:05 UTC
Come to think of it, it does seem to only happen when I use tab completion:

$ epm -qG bash-completion
app-shells/bash-completion-20050712

ACCEPT_KEYWORDS="~amd64"
Comment 3 SpanKY gentoo-dev 2005-07-22 14:53:30 UTC

*** This bug has been marked as a duplicate of 99540 ***