a new script to the menu system and how to call su (Re: Adding a script to make menu item work)
- To: debian-mentors@lists.debian.org
- Subject: a new script to the menu system and how to call su (Re: Adding a script to make menu item work)
- From: Gustavo Noronha Silva <kov@debian.org>
- Date: Mon, 2 Jul 2001 19:43:39 -0300
- Message-id: <20010702194339.169d9f9d.kov@debian.org>
- In-reply-to: <Pine.LNX.4.32.0106261032460.1058-100000@tpo2.sourcepole>
- References: <20010625233025.06c031cc.kov@debian.org> <Pine.LNX.4.32.0106261032460.1058-100000@tpo2.sourcepole>
Em Tue, 26 Jun 2001 10:34:59 +0200 (CEST)
"T.Pospisek's MailLists" <tpo2@spin.ch> escreveu:
> If you come up with somethink slightly general I'd be interested in it. I
> (am trying to) maintain xxdiff a graphical diff programm which will only
> start if it is passed two files as argument.
hmmm,
I was thinking about something like this:
---------------------->><<---------------------------
#!/bin/bash
function wait
{
echo "press any key to continue..."
read ANYKEY
}
if ! [ -x "$1" ]; then
echo "Error! $1 is not an executable file!"
wait
exit 1
fi
if [ -z "$2" ]; then
msg="I'm about to run $1, type the arguments you want to pass to it:"
else
msg="$2"
fi
echo "$msg"
read args
exec $1 $args
---------------------->><<---------------------------
you pass the command you wish to run (with no args...) and
the message you want to send to the user, ex:
run-with-args /bin/ls "what arguments you want to pass to ls?"
I think I'll implement a way to pass default arguments, would that
be needed?
I think a script like this (or this one) should be added to
the menu package, what you all think?
by the way I think su-to-root should call su with the full path..
should I file a wishlist bug? that seems a security hole...
[]s!
--
Gustavo Noronha Silva - kov <http://www.metainfo.org/kov>
*----------------------------------------------------------------*
| .''`. | Debian GNU/Linux: <http://www.debian.org> |
| : :' : | Debian BR.......: <http://debian-br.sourceforge.net> |
| `. `'` | Be Happy! Be FREE! |
| `- | "Think globally, act locally!" |
*----------------------------------------------------------------*
Reply to: