Problem with nesting commands

13 views
Skip to first unread message

Allen Ormond

unread,
Mar 27, 2006, 4:25:45 PM3/27/06
to YubNub
I've been working on a command that involves retrieving the string
output of a nested command and passing it into another command. It's
been slow going because YubNub doesn't like doing this very
consistantly.

Some examples, using the echo command:

echo {filterstring 1 hello world} -works
echo {strleft abcdeghasd 7} - doesn't work
echo {strFind -find b -string abcabc} - works
echo {sum 1 5} - doesn't work
echo {round 5.82} - works

Those last two are particularly frustrating as they both access the
same php file and are very similar commands, yet one works and the
other doesn't. Most of my other commands that output strings fail
(except ifthen).

Any ideas? Is this a problem with yubnub or a problem with my commands?
Any thoughts are appreciated. Thanks.

-Allen

Jonathan Aquino

unread,
Mar 28, 2006, 1:55:09 AM3/28/06
to Yub...@googlegroups.com, Allen Ormond
Allen - I've turned on stack dumps, which is something I've been meaning to
figure out how to do for a while. This will show more information about
what's wrong when an error occurs.

--
Jon Aquino (Victoria BC Canada)
http://jonathanaquino.com

Allen Ormond

unread,
Mar 28, 2006, 10:10:47 AM3/28/06
to YubNub
Thanks Jon,
I think I've figured out what's going wrong (or at least narrowed it
down);

I was doing some more tests with ifThen and noticed that this command
works:
echo {ifthen -value1 1 -value2 1 -test equal -then Yub -else Nub}
And this one doesn't:
echo {ifthen -value1 1 -value2 1 -test equal -then Yub Nub nub -else
Nub}

The only difference is that the second one has a parameter that has two
words in it. All the commands I'm having issues with are passing
multiple words in a single parameter. Looking at 'filterstring', I
noticed that that command doesn't produce an error even with multiple
words... So, why the different behaviour? All the commands that give
errors have [no url encoding], 'filterstring' doesn't.

I created 'ifthen2' which doesn't have [no url encoding] and it works
just fine.

So, I guess I need the [no url encoding] removed from a bunch of my
commands (why did I have it there in the first place?). Please remove
it from: ifThen, strLength, strReplace, sum, strFind, strLeft,
Multiply, Round, Subtract, Divide, strRight, wordcount.

Thanks Jon, and sorry for all the changes. Hopefully this will fix some
problems others are having (and not cause more problems).

-Allen

Brian

unread,
Mar 28, 2006, 2:35:32 PM3/28/06
to YubNub
I've noticed this fixes a problem I had been having with ifthen where
it strips everything after a "&".

For instance, in the command trib
(http://yubnub.org/kernel/man?args=trib ) I had to change & to %26 to
get it to work. I just tried a new version of the command with
"ifthen2" and it works fine with the &.

Brian

Jonathan Aquino

unread,
Mar 28, 2006, 6:39:40 PM3/28/06
to Yub...@googlegroups.com
YubNub is giving me "500 - Internal Server Error" - not sure what's going on
- I've submitted a ticket to my web host (TextDrive).

Jonathan Aquino

unread,
Mar 29, 2006, 1:41:06 AM3/29/06
to Yub...@googlegroups.com, aor...@gmail.com
Hi Allen - done. Actually I didn't do it for wordcount because I found that
"wordcount Hello World!" would return 1 for some reason. So I put it back.

--
Jon Aquino (Victoria BC Canada)
http://jonathanaquino.com

-----Original Message-----


From: Yub...@googlegroups.com [mailto:Yub...@googlegroups.com] On Behalf Of
Allen Ormond

Allen Ormond

unread,
Mar 29, 2006, 8:07:12 AM3/29/06
to YubNub
Thanks Jon!

Reply all
Reply to author
Forward
0 new messages