14 lines
299 B
Bash
14 lines
299 B
Bash
|
#!/bin/sh
|
||
|
if (($# < 2)); then
|
||
|
printf "Invalid usage\nPress enter\n" >&2
|
||
|
read
|
||
|
exit 2
|
||
|
fi
|
||
|
set -xe
|
||
|
OLD_FILE="$1"
|
||
|
shift
|
||
|
BASENAME="$(basename "$OLD_FILE")"
|
||
|
NEW_FILE="$(mktemp --suffix "${BASENAME##*.}")"
|
||
|
cp --no-preserve=all -- "$OLD_FILE" "$NEW_FILE"
|
||
|
exec "$@" "$NEW_FILE" >/dev/null 2>&1 & disown
|