Mail Archives: cygwin/2006/08/22/20:17:06
On Tue, 22 Aug 2006, Richard Foulk wrote:
> Aloha,
>
> I've installed Cygwin on a file server common to a large number of
> clients. This allows various tools and scripts to be run on any
> of the clients without cluttering them with their own installations.
>
> Occasionally it would be nice to obtain a quick interactive shell
> environment on one of the clients, including having /tmp, /etc and
> others in place on the server partition. Preferrably without leaving
> a lasting trace on the client. Perhaps by invoking a single batch file
> from the server partition.
>
> Is there a quick, easy, or already done, way of doing this?
Something like this is quick, dirty, and ought to do it:
@echo off
set SCRIPT_DIR=%~dp0
REM Set up mounts
%SCRIPT_DIR%bin\mount -u "%SCRIPT_DIR%" /
%SCRIPT_DIR%bin\mount -u "%SCRIPT_DIR%bin" /usr/bin
%SCRIPT_DIR%bin\mount -u "%SCRIPT_DIR%lib" /usr/lib
REM Start the Cygwin shell
call %SCRIPT_DIR%cygwin.bat
REM Clean up mounts
%SCRIPT_DIR%bin\umount -uA
(put it in your Cygwin root on the file server, won't work on Win9x/ME).
Note that this will trash the user mounts in your existing Cygwin
environment on the client (if there is one). Detecting existing Cygwin
user mounts using the mount command is left as an exercise for the reader.
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com
ZZZzz /,`.-'`' -. ;-;;,_ Igor Peshansky, Ph.D. (name changed!)
|,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"
--
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/
- Raw text -