[Bug 366665] Re: find wont use .bashrc alias
Stefan Wagner
hirnstrom at arcor.de
Sun May 21 02:27:34 UTC 2017
The -exec param of find is executed by find, not by the bash, and find
doesn't look into your aliases. This is expected behaviour. Find won't
neither execute bash functions. And it does not allow redirection like
such:
<code>
$ find -exec ls {} > /dev/null \;
<code>
You have to invoke bash as a login shell (-l) and set the shell option
"expand aliases". Read "man bash", especially section ALIASES, for
further insights.
<code>
$ find -type f -name "*.mp3" -exec bash -l -O expand_aliases -c "mp3gainB {}" ";"
</code>
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to findutils in Ubuntu.
https://bugs.launchpad.net/bugs/366665
Title:
find wont use .bashrc alias
Status in findutils:
New
Status in findutils package in Ubuntu:
Invalid
Bug description:
Binary package hint: findutils
i created this alias:
alias mp3gainB='mp3gain -r -k -t -p -s r'
then tried to run
$ find -type f -name "*.mp3" -exec mp3gainB {} \;
but it failed
running
$ find -type f -name "*.mp3" -exec mp3gain -r -k -t -p -s r {} \;
works as expected
ProblemType: Bug
Architecture: amd64
Dependencies:
libgcc1 1:4.3.3-5ubuntu4
gcc-4.3-base 4.3.3-5ubuntu4
findutils 4.4.0-2ubuntu4
libc6 2.9-4ubuntu6
DistroRelease: Ubuntu 9.04
NonfreeKernelModules: nvidia
Package: findutils 4.4.0-2ubuntu4
ProcEnviron:
PATH=(custom, user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: findutils
Uname: Linux 2.6.28-12-generic x86_64
To manage notifications about this bug go to:
https://bugs.launchpad.net/findutils/+bug/366665/+subscriptions
More information about the foundations-bugs
mailing list