I'm using the bash shell in CentOS, version ...
$ uname -a Linux mydomain.com 3.2.29-48.63.amzn1.x86_64 #1 SMP Sat Sep 15 01:43:12 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
In my shell script, I want to get part of a string, specifically, everything before the last dash ("-"). So if my string is "my-importer-1.0.ear," I want to extract "my-importer". However, the expression below
is only returning "my", because its matching against the first dash. How can I adjust the expression to match everything up until the last dash?