Register
It is currently Fri Apr 25, 2014 3:24 am

I can't get this alias to work


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Thu Jun 03, 2010 6:12 pm   

Joined: Thu Jun 03, 2010 5:53 pm
Posts: 2
I want to use this alias that I use on my work machine but I can't get it working on my home computer!

Code:
alias ff='find . -name \!* -print'


From the command line I was to be able to type "ff myFileName" or ff "*.txt" and things like that. It seems to work fine on my work machine. I keep getting and error

find: paths must precede expression: .txt
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]

I have no idea why. I'm new to aliases and scripts. Any help would be appreciated. Thanks!


Top
 Profile  
 PostPosted: Thu Jun 03, 2010 8:47 pm   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 512
you'd better use a function:
Code:
ff() { dir="$1" not="$2" find $dir ! -name "*$not" -print; }
and call
ff /home txt


Top
 Profile  
 PostPosted: Sun Jun 06, 2010 7:36 pm   

Joined: Thu Jun 03, 2010 5:53 pm
Posts: 2
It might of helped to take note that my work uses tcsh instead of bash... I feel dumb now.


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP