Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: From: "Schaible, Joerg" To: cygwin AT sourceware DOT cygnus DOT com Subject: RE: Ultimative way to start Windows 95/98/NT/2000 programs from b ash Date: Mon, 13 Nov 2000 13:46:01 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id HAA20885 Hi Klaus, My be you should remove now 95 and 98 from the subject . What about other executables or script files identified by PATHEXT ? Greetings, Jörg > -----Original Message----- > From: klaus DOT berndl AT sdm DOT de [mailto:klaus DOT berndl AT sdm DOT de] > Sent: Monday, November 13, 2000 1:20 PM > To: cygwin AT sourceware DOT cygnus DOT com > Subject: AW: Ultimative way to start Windows 95/98/NT/2000 > programs from > b ash > > > OK, here comes my last version of this way, this avoids all > the problems > you have mentioned: > > function open-file-with-w32 () { > erg="" > for i in $*; do > if [ -f "$i" ]; then > # get the extension only > erg=`echo $i | sed -e 's|.*\.||g;'` > # check if we try to open a bat or cmd file > if [ "$erg" != "bat" ] && > [ "$erg" != "BAT" ] && > [ "$erg" != "cmd" ] && > [ "$erg" != "CMD" ]; then > # check if this extension is associated with > a w32-program > erg=`cmd /c assoc ".$erg" 2>/dev/null` > if [ "$erg" != "" ]; then > # an associtiation exists therefore this call > # should theoretically not produce an error. > cmd /c start /b `cygpath -w "$i"` 2>/dev/null > else > # we must start the file with a text editor > emacs `cygpath -w "$i"` > fi > else > emacs `cygpath -w "$i"` > fi > fi > done > unset erg; } > alias o=open-file-with-w32 > > Now you can open all filetypes with their associated program and if no > association exists it will be opened with the text editor (here emacs) > > Hope this helps, > Klaus -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com