Greetings,
While extracting the first two characters from a string I noticed the
following:
$ str="-- foo bar blahblahblah"
$ echo "First 2 chars: ${str%${str#??}}"
First 2 chars: --
$ str="-- foo bar blahblahblah [foo]"
$ echo "First 2 chars: ${str%${str#??}}"
First 2 chars: -- foo bar blahblahblah [foo]
$
It seems that the presence of '[' and ']' is somehow disturbing the
substitution...
Quite similar behavior in bash (the only difference is that the
substitution works there when no chars are present in between the square
brackets).
Is this expected?
--
Alessandro De Laurenzis
[mailto:jus...@atlantide.mooo.com]
Web: http://www.atlantide.mooo.com
LinkedIn: http://it.linkedin.com/in/delaurenzis