Created
December 14, 2011 12:55
-
-
Save jahewson/1476464 to your computer and use it in GitHub Desktop.
loop over files in Bash, splitting filename and extension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# filter for .c files | |
for f in *.c | |
do | |
#filename | |
echo $f | |
# filename without extension | |
echo ${f%.*} | |
# extension | |
echo ${f#*.} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment