separating filename and extension

Shell Programming and Scripting

Kindly Note - This is a Single User Post by Forum Member radoulov Regarding:
separating filename and extension.
Please Follow The Primary Link Above to View the Full Discussion.

Old 04-06-2007
radoulov's Unix or Linux Image
radoulov radoulov is offline
Registered User
for f in test_suite/*.args;do 
	printf "filename without path and extension: %s, extension only: %s\n" "${fn##*/}" "${f##*.}"  

With bash you can do something like this (if I understand correctly the requirement):
set test_suite/*.args
set "${@##*/}"
printf "%s\n" "${@%.*}">file.out

Last edited by radoulov; 04-06-2007 at 07:40 AM..