Hi Klaus, My be you should remove now 95 and 98 from the subject <g>. What about other executables or script files identified by PATHEXT ? Greetings, J�rg > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Monday, November 13, 2000 1:20 PM > To: [EMAIL PROTECTED] > 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 [EMAIL PROTECTED]
