| delorie.com/archives/browse.cgi | search |
| 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: | <99B82AA9708ED0119B55006097125A00405B5F@ifk63.mach.uni-karlsruhe.de> |
| From: | Heribert Dahms <heribert_dahms AT icon-gmbh DOT de> |
| To: | "'klaus DOT berndl AT sdm DOT de'" <klaus DOT berndl AT sdm DOT de>, Joerg DOT Schaible AT gft DOT com, |
| cygwin AT sourceware DOT cygnus DOT com | |
| Subject: | RE: Ultimative way to start Windows NT/2000 programs from bash |
| Date: | Mon, 13 Nov 2000 22:57:12 +0100 |
| X-Priority: | 3 |
| MIME-Version: | 1.0 |
| X-Mailer: | Internet Mail Service (5.0.1457.3) |
Hi Klaus,
what about using $COMSPEC wrapped in cygpath
instead of hardcoding cmd to allow 9x again?
(Not that I'd like to use anything than NT 8-)
Bye, Heribert (heribert_dahms AT icon-gmbh DOT de)
> -----Original Message-----
> From: klaus DOT berndl AT sdm DOT de [SMTP:klaus DOT berndl AT sdm DOT de]
> Sent: Monday, November 13, 2000 15:08
> To: Joerg DOT Schaible AT gft DOT com; cygwin AT sourceware DOT cygnus DOT com
> Subject: AW: Ultimative way to start Windows NT/2000 programs
> from bash
>
> > My be you should remove now 95 and 98 from the subject <g>.
>
> Has been done.
>
> > What about other
> > executables or script files identified by PATHEXT ?
>
> Yes, good point! here is the next iteration (the last one i hope :-)
>
> # open any file in the correct program: an associated file-type (see
> assoc
> # and ftype at Windows NT/2000) will be opened with the associated
> program.
> # Not associated filetypes and files which extension is contained in
> # $PATHEXT will be opened in the texteditor (here Emacs). Files with
> # extension .exe and .com will not be opened!
>
> function open-file-with-w32 () {
> 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 program
> if [ "$erg" != "exe" ] &&
> [ "$erg" != "EXE" ] &&
> [ "$erg" != "com" ] &&
> [ "$erg" != "COM" ]; then
> # check if we try to open a file with a extension from
> $PATHEXT
> is_path_ext=`echo "$PATHEXT"\; | grep -i "\.$erg;"`
> if [ "$is_path_ext" == "" ]; then
> # check if this extension is associated with a
> w32-program
> erg=`cmd /x /c assoc ".$erg" 2>/dev/null`
> if [ "$erg" != "" ]; then
> # an associtiation exists therefore this call
> should
> # theoretically not produce amn error.
> cmd /x /c start /b `cygpath -w "$i"`
> 2>/dev/null
> else
> # we must open the file with a text editor
> because
> # it is not associated.
> emacs `cygpath -w "$i"`
> fi
> else
> # files with a extension contained in $PATHEXT
> will be
> # opened with the text editor.
> emacs `cygpath -w "$i"`
> fi
> else
> echo "$i is a program!"
> fi
> fi
> done
> unset erg is_path_ext; }
> alias o=open-file-with-w32
>
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |