I have a shell script with this code:
var=`hg st -R \"$path\"` if [ -n \"$var\" ]; then echo $var fi
But the conditional code always ex
With Bash's extended pattern matching features enabled (shopt -s extglob), you can use this:
shopt -s extglob
{trimmed##*( )}
to remove an arbitrary amount of leading spaces.