Created
November 1, 2012 03:21
-
-
Save revskill10/3991429 to your computer and use it in GitHub Desktop.
Bash file parameter extractor
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
~% FILE="example.tar.gz" | |
~% echo "${FILE%%.*}" | |
example | |
~% echo "${FILE%.*}" | |
example.tar | |
~% echo "${FILE#*.}" | |
tar.gz | |
~% echo "${FILE##*.}" | |
gz | |
for input in *.mpg; do avconv -i $input -vframes 1 -f image2 MPG/{input%.*}.jpg; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment