[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Edlug Archive Mar 2004 ]

Re: [edlug] Trouble With Scripts

Keith W Wyse <keithwwyse@xxx.xxx.xxx> writes:

> I've downloaded KeyChain - in the process of Fiddling.
> What I was trying to do was to create a table of aliases/functions which
> could serve as transparent links to the bits that are executed - but so
> that they could be used in gnome menus, app launchers, as well as in
> scripts.

AFAIK, you can't do that.  Aliases and functions are part of the shell,
so you have to evaluate them in the context of a shell.  Gnome apps
don't know about shell functions or aliases, all they are interested in
is executables.

> For example I would set up an alias 'ste' (for simple text editor) to be
> associated with 'gedit &'
> alias ste='gedit &'
> or
> function alias()
> {
> gedit &
> }
> But if I do this with aliases/functions - even if I set the launcher to
> 'run in script' it doesn't work.
> I wanted to keep away from having a directory full of scripts or
> symlinks, because they can't as easily be redirected as
> aliases/functions can. This would make admin of user's
> permissions/access to programs easier and would mean that some of the
> path could be trimmed of.

You couldn't control permissions this way anyway, because the user would
always have to have access to the original executable to be able to use
it via. the alias/function, so removing the function wouln't take away
access to the executable.

> Is there a solution out there already or is that what KeyChain is for?

The keychain I know about (written by DRobbins of Gentoo fame, this may
be a different one, of course) is for managing an ssh-agent so it can be
used in multiple shells.  It could probably be modified to output
aliases/functions to be defined in to the shell, but it seems like a lot
of work for no gain...

I'd recommend the aformentioned symlinks -- make a directory ~/.bin/,
stick it as the first element in the path, and put symlinks in there to
wherever you want overridden.  You could also put system-wide default
symlinks in /etc/default-bin, second place in the path.  I seem to
recall hearing that Debian does (something similar to) this for you

Andrew Aylett | www.aylett.co.uk | 1.79 x 10^12 furlongs per fortnight...
andrew@xxx.xxx.xxx | answer==42 |  -- it's not just a good idea, it's the law!

Attachment: pgp00008.pgp
Description: PGP signature

This archive is kept by wibble@morpheux.org.DONTSPAMME