Bash -c without exiting

View: New views
5 Messages — Rating Filter:   Alert me  

Bash -c without exiting

by patrickinminneapolis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'd like to drop to the current directory like this,  

bash --login -i -c 'Drop to current directory'

without exiting cygwin. Thanks.

Re: Bash -c without exiting

by Igor Peshansky :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 25 Sep 2007, patrickinminneapolis wrote:

> I'd like to drop to the current directory like this,
>
> bash --login -i -c 'Drop to current directory'
>
> without exiting cygwin. Thanks.

Not Cygwin-specific.  Try

bash --login -i -c 'cd /tmp && exec bash'

HTH,
        Igor
--
                                http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_    pechtcha@... | igor@...
ZZZzz /,`.-'`'    -.  ;-;;,_ Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-' old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Belief can be manipulated.  Only knowledge is dangerous.  -- Frank Herbert

--
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/


Re: Bash -c without exiting

by patrickinminneapolis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I modified Cygwin.bat to the following,
bash --login -i -c 'cd /cygdrive/c && exec bash'
and it still exits.



RE: Bash -c without exiting

by Dave Korn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 26 September 2007 15:09, patrickinminneapolis wrote:

> I modified Cygwin.bat to the following,
> bash --login -i -c 'cd /cygdrive/c && exec bash'
> and it still exits.

  Use double quotes; this batch file is parsed by cmd.exe, which doesn't
recognize single quotes, but it does recognise the '&&' token, so it breaks
the line there and attempts to run

bash --login -i -c 'cd /cygdrive/c

followed by (if that exits with no error status)

exec bash'

which it doesn't understand!

    cheers,
      DaveK
--
Can't think of a witty .sigline today....


--
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/


Re: Bash -c without exiting

by Warren Young :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

patrickinminneapolis wrote:
> I modified Cygwin.bat to the following,
> bash --login -i -c 'cd /cygdrive/c && exec bash'
> and it still exits.

I think you can get the effect you want by changing your home directory
in /etc/passwd to /cygdrive/c

--
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/