# for i in /usr/local/bin/test.ext /usr/local/bin/test test.ext test; do \
perl -le 'printf "Src: %s\n\tPath: %s\n\tFile: %s\n\tName: %s\n\tExt: %s\n",$ARGV[0],($ARGV[0]=~ m#^(.+/|)(([^.]+).?(.+?|))$#)' $i; \
done
Src: /usr/local/bin/test.ext
Path: /usr/local/bin/
File: test.ext
Name: test
Ext: ext
Src: /usr/local/bin/test
Path: /usr/local/bin/
File: test
Name: test
Ext:
Src: test.ext
Path:
File: test.ext
Name: test
Ext: ext
Src: test
Path:
File: test
Name: test
Ext: