If I store a long string in a variable and need to test if the string would begin with the letters abc, what would be the most efficient way to test this?
Of course, you could echo the string and pipe it to grep/awk/sed or something like that but isn't there a more efficient way (which doesn't require to scan the whole string?)?
Can I use a case statement for this, like e.g.
case $var in
^abc) doSomething;;
esac
?
Greets, Oliver