From: Alex Dehnert Date: Sun, 21 Apr 2013 20:26:59 +0000 (-0400) Subject: Add a "screen" subcommand to krbroot X-Git-Url: https://www.dehnerts.com/gitweb/?p=user%2Falex%2Fsoftware%2Fmy-snippets.git;a=commitdiff_plain;h=aa6f780a758a977cdcecee9ff45b3f428440a1b0 Add a "screen" subcommand to krbroot I have screen profiles for "all scripts web servers", "all scripts hosts", etc., which means I often want to run screen with root tickets and pass it some options. This makes that easy. This uses the technique from ASA DB commit 08d4fa6744d2785023666d10a1936460811fcdb2 (https://asa.scripts.mit.edu/trac/changeset/08d4fa6744d2785023666d10a1936460811fcdb2) to pass commands possibly containing metacharacters through pagsh without quoting issues. --- diff --git a/krbroot b/krbroot index 5f475af..ee98c87 100755 --- a/krbroot +++ b/krbroot @@ -14,6 +14,10 @@ case $1 in klist -s || krbroot init || exit 1; HOST="`hostname` (krbroot)" pagsh -c $SHELL ;; + screen) + klist -s || krbroot init || exit 1; + HOST="`hostname` (krbroot)" pagsh -c 'exec "$@"' exec "$@" + ;; ssh) klist -s || krbroot init || exit 1; shift