How to check, if a string is ending with a number?

I have makefile shared by multiple projects, which links shared libraries. The sources -- and the library-names -- are set by each project's own GNUmakefile.

When the library-name (${SO}) contains the version ( I need to to create a symlink: ->

What's the elegant way to remove the version-number in this example?

SO_LINK=$(???? ${SO})
      ln -sf ${SO} ${SO_LINK}

Read more here:

Content Attribution

This content was originally published by Mikhail T. at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: