From d4698bca257fbce2e5710fc3e9390779a2203a48 Mon Sep 17 00:00:00 2001 From: eshanized Date: Tue, 16 Apr 2024 18:21:33 +0530 Subject: [PATCH] =?UTF-8?q?=E2=8F=B3=20@eshanized=20updated=20the=20reposi?= =?UTF-8?q?tory=20=F0=9F=8E=89=20!!!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- usr/bin/exec-terminal | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/usr/bin/exec-terminal b/usr/bin/exec-terminal index c05767c..67b7a76 100644 --- a/usr/bin/exec-terminal +++ b/usr/bin/exec-terminal @@ -22,3 +22,16 @@ while getopts "${opts}" arg; do ;; esac done + +shift $(($OPTIND - 1)) + +initfile="$(mktemp)" +codefile="$initfile" +echo "#!/usr/bin/env bash" >"$initfile" +if [ "$EXEC_TERMINAL" != "bash" ]; then + codefile="$(mktemp)" + echo "$EXEC_TERMINAL $codefile" >>"$initfile" +fi +echo "$1" >>"$codefile" +chmod +x "$initfile" +cmd="\"$initfile\""