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

Re: (g)mc-4.5.38-2 still broken



* Martin Bialasinski said:

> Marek> /etc/csh.cshrc (and possibly other global shell startup
> Marek> scripts) an alias definition, or a function to call mc in a way
> Marek> which would preserve the exit path of mc?
> 
> No, directly changing files part of other packages is not allowed by
> policy.
Hmm... couldn't it be done in a similar way like with inetd.conf? That a
program, in this case MC, would register an alias with the shell startup
scripts?
 
> Marek> a command from within mc or just does Ctrl-O another subshell
> Marek> is invoked by MC - that's three copies of bash for one run of
> Marek> MC.
> 
> No, ^o doesn't open a new shell. If you just start mc, you get 
> 
>  6832 ttyp8    S      0:00              |       \_ bash /usr/bin/mc 
>  6833 ttyp8    S      0:00              |           \_ /usr/bin/mc.real -P
>  6835 ttyp5    S      0:00              |               \_ bash -rcfile .bashrc
> 
> ^o doesn't change a thing.
> 
> Starting a program (wether in the for- or background) just adds this
> programm like in 
That's right, I was wrong. But still, using a shell script to invoke MC just
for the sake of the exit path preservation is a waste of memory. If the
alias/function cannot be added to the shell startup scripts for the policy reasons,
then maybe it could be included in the skeleton files? Something like this
(for POSIX-compliant shells):

mc() {
  if [ -x /usr/bin/mc ]; then
	MC=$(/bin/mktemp /tmp/mc.XXXXXX)
	/usr/bin/mc -P "$@" $MC > $MC
	cd $(cat $MC)
	rm -f $MC
  fi
}

This function put in skeleton would be present for all new users, however a
better place would be in the global startup scripts.

marek

Attachment: pgptcgQA8YM3s.pgp
Description: PGP signature


Reply to: