Friday, August 26, 2005

First command to use ifThen command

Wow! Fuska sent me an email about a command he created called Microsiervos. The cool thing about this command is that it is the first command to use Allen Ormond's ifthen command. And it does what some of you have requested: go to one URL if an argument is given; another URL if no argument is given. I was not aware that the problem could be solved in this way. Fuska writes:
I created a new command to search in microsiervos.com a spanish blog that I recommend you (it isn`t mine).

The interesting thing about this command is that this is the first command which uses the ifthen command. At least I didn't find any other command.

The ifthen command changes the url pointing to the main page(if there isn't search query) or to the search page

The code of the command is this:
http://www.microsiervos.com{ifThen -value1 %s -value2 -test NOTEQUAL -then /msmt/mt-search.cgi%3FIncludeBlogs=1%26search=%s}

And this is the man page:
http://yubnub.org/kernel/man?args=Microsiervos
I'm really impressed! It takes a village to build a command line!!

3 Comments:

Anonymous Allen Ormond said...

Great job Fuska! I hadn't thought of using ifThen in quite that way. I'm glad it was useful for you! :)

8/27/2005 6:06 AM  
Anonymous eliazar said...

Inspired by this technique I created ifEmpty, which is just a simple alias that makes such redirections more convenient.

2/15/2006 3:17 AM  
Blogger Jonathan said...

nice one eliazar - I'll definitely use that one next time.

2/17/2006 11:49 PM  

Post a Comment

<< Home