This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

AW: Ultimative way to start Windows 95/98/NT/2000 programs from bash


Ok, here comes a more ultimative way :-)

A slightly enhancement to my previous function:

# open any file in the correct program: a registered file-type (see assoc
# and ftype at W32) will be opened with the associated program. If this
# fails (maybe because the filetype is not registered) the file will be
# opened with the texteditor (here Emacs).
function open-file-with-w32 () {
    for i in $*; do
        cmd /c /q start /b `cygpath -w "$i"` 2>/dev/null || e `cygpath -w "$i"`
    done; }
alias o=open-file-with-w32

Only replace the 'e' in this function with your text-editor-command (for me
'e' starts Emacs).

Now you can open *all* filetypes simply with 'o' regardless if they are 
associated with a program in Windows NT.

Klaus

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]