[ILUG] find alias problem

Kenn Humborg kenn at research.wombat.ie
Thu Nov 18 01:03:51 GMT 1999


On Wed, Nov 17, 1999 at 01:54:43PM -0000, David Meagher wrote:
[...snip...]
> alias findfile='find / -name "$2" -print
[...snip...]
> it wouldn't work

RTFM.  From man bash:

       There  is no mechanism for using arguments in the 
       replacement text, as in csh.  If arguments
       are needed, a shell function should be used.

Add this to your .bashrc:

function findfile
{
   find / -name "$1" -print
}

Later,
Kenn





More information about the ILUG mailing list