Scripts now work with bash

This commit is contained in:
2019-05-03 09:45:06 +02:00
parent ab5eefef97
commit 085fff8534
4 changed files with 39 additions and 39 deletions

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
# Swap files
if [ $# -ne 2 ]; then
@@ -7,12 +7,12 @@ if [ $# -ne 2 ]; then
fi
if [ -f $1 ] && [ -f $2 ]; then
local tmp=`mktemp`
tmp=`mktemp`
mv "$1" "$tmp"
mv "$2" "$1"
mv "$tmp" "$2"
elif [ -d $1 ] && [ -d $2 ]; then
local tmp=`mktemp -d`
tmp=`mktemp -d`
mv "$1" "$tmp"
mv "$2" "$1"
mv "$tmp/$1" "$2"