Skip to content

Instantly share code, notes, and snippets.

View logic's full-sized avatar

Ed Marshall logic

View GitHub Profile
#!/bin/sh
# Replacement for raw "ksu" in kerberized environments;
# behaves more like "su -", and retains xauth data.
if [ $# -lt 1 ]
then
echo "Usage: `basename $0` <target user> [ <command> [ <arg> ] ... ]"
exit 2
fi
# Append to /root/.bashrc
[ ! -d $HOME/.history ] && mkdir $HOME/.history
set -- `/usr/bin/who -m`
HISTFILE="$HOME/.history/`/bin/date +%Y-%m-%d.%T`.`/bin/hostname -s`.$$.$1"