The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
please help me regarding alias naree Shell Programming and Scripting 17 06-03-2008 01:14 AM
How to get the alias,when we have the IP. preethgideon UNIX for Dummies Questions & Answers 2 07-24-2007 11:53 AM
alias help shafique UNIX for Dummies Questions & Answers 5 10-03-2006 09:56 AM
Help with find command on a shortcut directory(Alias)??? swamy455 UNIX for Dummies Questions & Answers 2 07-07-2005 10:32 AM
Alias klannon UNIX for Dummies Questions & Answers 2 03-10-2002 02:54 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 01-24-2002
sTorm's Avatar
Registered User
 

Join Date: Jan 2002
Location: Switzerland, Zurich
Posts: 32
Question alias for find

I've tried to define an alias for the find cmd. I want a find -name and send the error messages to /dev/null. I entered the alias as followed:
# alias myfind 'find $1 -name $2 2>/dev/null'
But it didn't work. Any idea what's wrong with that?
Forum Sponsor
  #2  
Old 01-26-2002
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,619
You are probably using the korn shell or some shell similiar to it. They don't have powerful alias commands that can handle stuff like that. You must use functions instead:

myfind() { find $1 -name $2 2>/dev/null ; }
  #3  
Old 01-28-2002
sTorm's Avatar
Registered User
 

Join Date: Jan 2002
Location: Switzerland, Zurich
Posts: 32
thx, that worked!
__________________
regards,
sTorm
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:50 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0