Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- #this could be cleaner, but it makes a new dir, CD's into it, and unzips the zip file in there.
- #useful when people release windows programs.
- #wyatt ward 2014
- #USUAL "WITHOUT ANY WARRANTY IMPLIED OR OTHERWISE" THING HERE
- export INFILENAME=`echo "$@" | awk -F/ '$0=$NF'`
- export OUTPUTDIR=`echo "$INFILENAME" | sed 's/.zip//g'`
- echo "OUTPUTDIR is"
- echo "$OUTPUTDIR"
- export STARTINGDIR="$PWD"
- if [ -f "$1" ]
- then
- echo "Found file."
- mkdir "$OUTPUTDIR"
- cd "$OUTPUTDIR"
- if [ `echo "$1" | grep [/]` ]
- then
- #echo "yeah, starts with a slash"
- unzip "$1"
- else
- #echo "no slash"
- unzip "$STARTINGDIR/$1"
- fi
- # unzip "$1"
- else
- echo "$1 not found. Sorry."
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement