tcsh and chere-0.3-1
Andrew Grimm
agrimm@redwood.rsc.raytheon.com
Thu Oct 14 19:53:00 GMT 2004
Igor Pechtchanski said:
> > Does anyone know of a way to get a `-` at the start of $0? I believe
> > this will force all the shells to start as login shells and is the
> > most generic solution.
>
> Sure. 'bash -c "exec -l $PROG $ARGS"'. :-)
Ya beat me to it :) Although, in the current design, this would make a
bash shell call a login shell call a normal shell (for the cd) which is a
bit of a quoting nightmare.
You could make a support script (/bin/shere) that did somehting like this:
#!/bin/bash
# shere: run login shell arg1 in directory arg2
[ -x "$1" -a -d "$2" ] || exit 1;
dir=$(/bin/cygpath -u "$2")
exec -l $1 -c "cd \"$dir\"; exec $1"
Then the command you send would turn into something as simple as:
C:\cygwin\bin\rxvt.exe -e /bin/shere /bin/tcsh.exe '%L'
If you hate the idea of making another script (I do too) you could turn
chere into a bash script, and add an arg like "chere -e <shell> <dir>"
which runs the above. Then chere would do its work by registering a call
to chere.
-Andy
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list