Hi,
I'm a newbie to shell scripting and have searched the forum but couldn't find what i was looking for.
Basically I have a list of filenames like...
123-fileone.txt
I want to be able to extract the prefix up to the first '-'. So I'd end up with 123. I have attempted it using a pretty basic regex ({F%-*}) but that trips up when there is more than 1 occurrence of '-' in the filename, which there can be.
I'm sure it's a simple thing to do...just not for me
Thanks.
Kirk.