Skip to content

Instantly share code, notes, and snippets.

@revskill10
Created November 1, 2012 03:21
Show Gist options
  • Save revskill10/3991429 to your computer and use it in GitHub Desktop.
Save revskill10/3991429 to your computer and use it in GitHub Desktop.
Bash file parameter extractor
~% 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