I'm having trouble matching a wilcarded string in the
sh shell. The code is part of a
configure.ac so it usually gets the lamest shell available. I can't count on the Bash shell.
The code first executes:
And I sometimes get a string like
ld -m x86_64 or
ld -m elf64lppc, but I want just
ld as a friendly display name.
case "$LDNAME" in "ld -m*") LDNAME=ld ;; esac
The string fails to match and I get the original string back. I've also tried
ld -m * (without quotes) and a few other variations with the same result.
How do I match a wilcarded string in case statement using
This works but it is not very extensible:
if test "$LDNAME" = "ld -m elf_x86_64"; then LDNAME=ld fi if test "$LDNAME" = "ld -m elf64lppc"; then LDNAME=ld fi