View Single Post
Old 01-26-2013, 12:12 PM   #163
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,552
Karma: 6021146
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
http://landley.net/mantis/mantis-2924.html

Quote:
The shell construct:

${varname:begin:end} does not produce the substring of $varname starting at begin and going to end.

example:

#!/bin/ash

mystr="This is a string"
echo $mystr
mysubstr=${mystr:0:4}
echo $mysubstr
#end of example

Expected output:
This is a string
This

Actual output:
This is a string
./testscript: line 5: syntax error: Bad substitution
thought it looked familiar

so

Quote:
if [[ \" = ${x:0:1} ]]; then
is just trimming the first char for a test? perhaps I can bodge that another way

EDIT:

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

Last edited by twobob; 01-26-2013 at 12:29 PM.
twobob is offline   Reply With Quote