Skip to content

Instantly share code, notes, and snippets.

@Chandru-B
Created September 11, 2019 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chandru-B/07a37788738d82e67d9b72bef21c91fb to your computer and use it in GitHub Desktop.
Save Chandru-B/07a37788738d82e67d9b72bef21c91fb to your computer and use it in GitHub Desktop.
bash unzip filename split string
#!/usr/bin/env bash
for f in *.zip; do
echo $f
# echo $filedate
filedate=${f##*_}
filedate="$(cut -d'.' -f1 <<<"$filedate")"
echo $filedate
unzip $f -d $filedate
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment