Shooting for straight Bourne shell. This seems to do the trick: [leam at shaphan ~]$ fred=my.script.rb [leam at shaphan ~]$ echo $fred | sed 's/\.[a-z]*$/\.txt/' my.script.txt On 04/06/16 20:48, Pete Hardie wrote: > One question on that - I assume it's bash only and not original(tm) > Bourne shell?