summaryrefslogtreecommitdiff
path: root/etc/functions/extract
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-04-02 11:32:38 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2010-04-02 11:32:38 +0200
commitf0f3c02a3ccde07d3dc79577c7eca41ea3e8e86f (patch)
treed0aaab1de872a30a94555d2da3b501e13e18c217 /etc/functions/extract
parent81ac4a06bff278f07620804b7d4120342b1f6522 (diff)
Replace $var by ${var}
Diffstat (limited to 'etc/functions/extract')
-rw-r--r--etc/functions/extract36
1 files changed, 18 insertions, 18 deletions
diff --git a/etc/functions/extract b/etc/functions/extract
index 9312678..2156dab 100644
--- a/etc/functions/extract
+++ b/etc/functions/extract
@@ -2,25 +2,25 @@
## Extract archives
## Usage: extr <file>
-if [[ -f $1 ]] {
- case $1 in
- *.(tar.bz2|tbz2)) tar xvjf $* ;;
- *.(tar.gz|tgz)) tar xvzf $* ;;
- *.tar.lzma) unlzma $1 | tar xv ;;
- *.ace) unace e $1 ;;
- *.rar) unrar x $1 ;;
- *.deb) ar -x $1 ;;
- *.bz2) bunzip2 $1 ;;
- *.lzh) lha x $1 ;;
- *.gz) gunzip $1 ;;
- *.tar) tar xvf $* ;;
- *.zip) unzip $1 ;;
- *.Z) uncompress $1 ;;
- *.cpio) cpio --no-absolute-filenames -idv < $1 ;;
- *.lzma) unlzma $1 ;;
- *) echo "Unknown archive type: $1"; return 2 ;;
+if [[ -f ${1} ]] {
+ case ${1} in
+ *.(tar.bz2|tbz2)) tar xvjf ${*} ;;
+ *.(tar.gz|tgz)) tar xvzf ${*} ;;
+ *.tar.lzma) unlzma ${1} | tar xv ;;
+ *.ace) unace e ${1} ;;
+ *.rar) unrar x ${1} ;;
+ *.deb) ar -x ${1} ;;
+ *.bz2) bunzip2 ${1} ;;
+ *.lzh) lha x ${1} ;;
+ *.gz) gunzip ${1} ;;
+ *.tar) tar xvf ${*} ;;
+ *.zip) unzip ${1} ;;
+ *.Z) uncompress ${1} ;;
+ *.cpio) cpio --no-absolute-filenames -idv < ${1} ;;
+ *.lzma) unlzma ${1} ;;
+ *) echo "Unknown archive type: ${1}"; return 2 ;;
esac
} else {
- echo "No such file: $1"
+ echo "No such file: ${1}"
return 1
}