how about in bash barename basename sed e 's ' barename dira dirb somebasefile ext somebasefile