Skip to content

Instantly share code, notes, and snippets.

@ymauray
Created July 15, 2016 05:40
Show Gist options
  • Save ymauray/61872a2d58e18907f8682d0b4401f089 to your computer and use it in GitHub Desktop.
Save ymauray/61872a2d58e18907f8682d0b4401f089 to your computer and use it in GitHub Desktop.
#! /bin/bash
a=/tmp/xx/file.tar.gz
# /tmp/xx
xpath=${a%/*}
# file.tar.gz
xbase=${a##*/}
# gz
xfext=${xbase##*.}
# file.tar
xpref=${xbase%.*}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment