Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i access $1 in a ksh function/alias?

Status
Not open for further replies.

jouell

MIS
Nov 19, 2002
304
US
hi

i have a environment file i exec whenever i login that contains all my aliases.

i would like to create an alias or function that helps me use the find command since i use it so often:

fh()
{
it=$1
find . -name $it -print
}


i get : find: missing conjunction

when i run it. any ideas?

thanks!
john



 
You can't access arguments in an alias definition.
Instead use a function, for example the following function lists the last created files :
[tt]
der() {
ls -lt "$@" | head
}
[tt]


Jean Pierre.
 
thanks,

i had an alias AND a function defined so my alias took precedence it appears!

=)

thanks JP
-john
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top