This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: tcsh and chere-0.3-1

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:

# 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.


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]