Register
It is currently Sat Nov 22, 2014 8:20 am

eval and command line args


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Fri Apr 23, 2010 2:51 pm   

Joined: Fri Apr 23, 2010 2:45 pm
Posts: 1
I have a perl script which performs some logic to determine a path location. This script can take a parameter. So for example, "path.pl kernel" might return "cd ../../kernel" or something like that. Running it without an argument returns a path to the root of my project, e.g. "cd ../.."

The I setup an alias to eval this:

alias rp = 'eval `path.pl $*`'

So now, typing 'rp' does in fact change my working directory to the project root.

But running 'rp kernel' also takes me to the project root, so it apparently isn't taking the argument.

I'm hoping this is just a syntax problem...


Top
 Profile  
 PostPosted: Fri Apr 23, 2010 3:36 pm   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 567
Code:
alias rp='path.pl'
and that's it.

note that there are no spaces around the equal sign.


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 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:  
cron


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