check variable content size in sh script

Quartz quartz at
Sat May 18 15:58:34 UTC 2013

>> newfoo=${foo:0:51}
> That works for bash, not sh.

Ok granted, but I don't think that ${#foo} is straight sh either, so I 
assumed "things bash/tcsh/ksh/whatever accept when running in sh 
emulation" were ok.

it has a certain smooth-brained appeal

More information about the freebsd-questions mailing list