View Single Post
Old 03-28-2012, 05:28 PM   #29
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773670
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by jmseight View Post
Hi,

I tried
ST="$ST$L"

and whenever I hit the space things seems to get messed up so I cna no longer type anything else except Aa to terminate the script.

The echo command
ST="$(echo \"$ST$L\")"

also does the same thing, except a lot of " signs are added to the string.

Thanks,
JAmes
Like I said, I did not test it. It was just something that *should* work. The problem is, many things that *should* work in these versions of busybox do not work as expected, requiring more tinkering than you would expect.

However, I just tried this on my K3:

# ST="abcdefg"
# L=" "
# ST="$ST$L"
# echo "($ST)"
(abcdefg )
#


Notice that the space was appended to ST as expected, so your problem must be in other code. Still, the quotes are needed to prevent chopping the trailing space off the string, like I said...

After looking at your code again, I see another problem:

eips $XP $YP $ST"_ "

really should be:

eips $XP $YP "$ST_ "

Otherwise, a space in ST will expand the 3rd parameter into a 3rd and 4th parameter that will make eips unhappy, giving an error message to STDERR. In linux, parameters that may contain spaces MUST be enclosed in quotes. It's the law! Fear it! (Only leave out quotes when you know you can get away with it, like I do.)

Last edited by geekmaster; 03-28-2012 at 05:35 PM.
geekmaster is offline   Reply With Quote