[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

a new script to the menu system and how to call su (Re: Adding a script to make menu item work)



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: