Skip to content

Instantly share code, notes, and snippets.

@tatic0
Created March 13, 2016 21:56
Show Gist options
  • Save tatic0/a01ed43564600ba05c5a to your computer and use it in GitHub Desktop.
Save tatic0/a01ed43564600ba05c5a to your computer and use it in GitHub Desktop.
explode filename and extension
#!/bin/bash
filename=file.png
echo "${filename:0:(-4)} <--> ${filename:(-4)}"
@tatic0
Copy link
Author

tatic0 commented Mar 13, 2016

darn ugly, must be 3 letter extensions.
just like playing with string in twisted ways ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment