bash - extract file name from full file name -
#!/bin/bash files=src/*.erl shopt -s nullglob f in $files echo "processing $f file..." # ??? done
how can extract file name full path? , mean - "pathfilename=${f%.*}"?
i'll copy help-output, since has examples , everything.
~$ basename --help usage: basename name [suffix] or: basename option print name leading directory components removed. if specified, remove trailing suffix. --help display , exit --version output version information , exit examples: basename /usr/bin/sort output "sort". basename include/stdio.h .h output "stdio".
Comments
Post a Comment