8 kt - Run command in background terminal; keept(1) convenience wrapper
12 kt [jobs | I<COMMAND> I<ARGS>]
16 Run I<COMMAND> in a keept(1) session, so you may send it to the background
17 with all of its terminal I/O, and recall with the same C<kt COMMAND ARGS>
20 Call C<kt jobs> to show running command sessions.
24 Stores control files in F<~/.cache/keept>.
35 if [ $# = 0 -o "$1" = --help ]
37 echo "Usage: kt [jobs | <COMMAND> <ARGS> ...]"
38 echo "Run COMMAND in a background terminal, which you can re-attach to with the same command."
39 echo "\"kt jobs\" list running jobs."
40 echo "See keept(1) which does the heavy lifing."
46 for cmdfile
in ~
/.cache
/keept
/kt-
*.txt
48 socket
=${cmdfile:0:-4}
49 if grep -q "$socket" /proc
/net
/unix
51 started
=`stat -c %y "$socket" | cut -f1 -d.`
53 pwd=`cat "$socket.cwd"`
54 echo "$started $pwd $cmd"
60 command_hash
=`echo -n "$*" | md5sum | cut -c 1-32`
64 mkdir
-p ~
/.cache
/keept
66 pwd > ~
/.cache
/keept
/kt-
$command_hash.cwd
67 echo "$@" > ~
/.cache
/keept
/kt-
$command_hash.txt
69 exec keept bwut ~
/.cache
/keept
/kt-
$command_hash "$@"