This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: tcsh and chere-0.3-1
- From: Andrew Grimm <agrimm at redwood dot rsc dot raytheon dot com>
- To: cygwin at cygwin dot com
- Cc: d_inabox at yahoo dot com
- Date: Thu, 14 Oct 2004 13:13:29 -0600 (MDT)
- Subject: 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:
#!/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/