Monday, December 12, 2005

Feature Request: Positional Parameters

Vincent Borghi had an interesting feature request: positional parameters. So instead of typing

gloc -what pizza -where seattle

you could just go

gloc pizza seattle

The command itself would be written with $1, $2, ... to indicate the first word, second word, etc.

Would someone be willing to write (and host) a command (call it, say, positional) that other commands could in turn call?

3 Comments:

Blogger fuska said...

well, maybe this is what you are looking for:

I've created this command:
http://www.yubnub.org/kernel/man?args=strWordNumber
strWordNumber - Returns a word for a given phrase

This alias for the previous one:
http://www.yubnub.org/kernel/man?args=%25
(I choose the percent(%) because we can refer the params like in a msdos batch file (%1, %2 ...) and because the dollar($) was already in use :(

And this other command:
http://www.yubnub.org/kernel/man?args=googlocal
for... well try it yourself:
googlocal pizza seattle

PS: could you delete this OTHER command:
http://www.yubnub.org/kernel/man?args=srtWordNumber
It has a mistake in its name and may be confusing

12/14/2005 10:59 AM  
Blogger Jonathan said...

Fuska - very clever!!!

Sure I will delete the command you mentioned.

12/16/2005 11:30 PM  
Anonymous blu3zirux said...

Thats really cool. Definatly useful.

12/29/2005 6:04 AM  

Post a Comment

<< Home