View Single Post
Old 01-26-2013, 01:12 PM   #169
DuckieTigger
Wizard
DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.
 
DuckieTigger's Avatar
 
Posts: 4,742
Karma: 246906703
Join Date: Dec 2011
Location: USA
Device: Oasis 3, Oasis 2, PW3, PW1, KT
Quote:
Originally Posted by twobob View Post
so

is just trimming the first char for a test? perhaps I can bodge that another way

EDIT:
Code:
if [[ \" = $( `echo $x | awk '{print substr ($0, 0, 1)}'` ) ]]; then


maybe??
You can probably try with head as well:
Code:
if [[ \" = $( `echo $x | head -c 1` ) ]]; then
Might be faster than calling awk? Combined with tail, you could get any substring out. Like:
Code:
echo $x | head -c 3 | tail -c 2
And my bad, it is indeed what you thought initially - the substring handling is the part that it does not like. Busybox must have extended the shell to be somewhat more bash like in later versions.
DuckieTigger is offline   Reply With Quote