delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/11/10/19:19:58

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <C9A98ED35114D31197D000805FEA668E0176E59D@mucexch.muc.sdm.de>
From: klaus DOT berndl AT sdm DOT de
To: cygwin AT sourceware DOT cygnus DOT com
Subject: Ultimative way to start Windows 95/98/NT/2000 programs from bash
Date: Sat, 11 Nov 2000 01:18:19 +0100
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id TAA12955

the following method to start w32-program avoids a minor bug in bash: if
you start a w32-gui-program in the background from bash and then exit the
started program bash eats up almost all cpu-power until you hit RET at bash so
the message "...Done" occurs. (This bug was discussed a lot some time ago)
 Therfore we use the NT cmd.exe to start such programs.

Here comes what i have done for me in my .bashrc:

# opens a registered file-type (see commands assoc and ftype at
#  Windows NT) with the associated program.
function open-w23-registered-file-types () {
    for i in $*; do
        cmd /c start /b `cygpath -w "$i"`
    done; }

alias o=open-w23-registered-file-types 

Then you can open any registered file-type with a command like:

o file1.txt ~/worddata/*.doc file2.xls

This would open file1.txt in my NTEmacs, all word-documents in Winword and
file2.xls in Excel.

BTW: One of the greated advantages of this method is, that all files of the same type are opened
in the **same** instance of the related program. 
In contrast to that opening a word document (.doc) with a call like

winword <filename>.doc &

always starts a new instance of word!!

Hope this is useful for someone else,
Klaus


-- 
Klaus Berndl			mailto: klaus DOT berndl AT sdm DOT de
sd&m AG			http://www.sdm.de
software design & management	
Thomas-Dehler-Str. 27, 81737 München, Germany
Tel +49 89 63812-392, Fax -220


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019