From: "E. Jay Berkenbilt" <ejb@ql.org>
To: zsh-users@sunsite.auc.dk
Subject: a nice su function
Date: Tue, 12 Sep 2000 17:59:28 -0400 [thread overview]
Message-ID: <200009122159.RAA11176@soup.ads.apexinc.com> (raw)
I like to use zsh when I'm root as well as when I'm myself, so I have
this little su function I threw together. I post it here in case
others may find it useful and in case someone may point out a better
way to do something I've done here. Basically, if I don't specify -
or -f I want -fc /bin/zsh appended to whatever I pass to su.... This
function seems to do the trick for me.
function su
{
local add_args
local args
add_args=1
args=($*)
for i in $*; do
if [ $i = "-" ]; then
add_args=0
elif [ "${i:#-f*}" = "" ]; then
add_args=0
fi
done
args=($*)
if [ $add_args = 1 ]; then
args=($args -fc /bin/zsh)
fi
command su $args
}
reply other threads:[~2000-09-12 22:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200009122159.RAA11176@soup.ads.apexinc.com \
--to=ejb@ql.org \
--cc=zsh-users@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).