delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/06/08/10:59:38

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Wed, 8 Jun 2005 10:59:27 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: zzapper <david AT tvis DOT co DOT uk>
cc: cygwin AT cygwin DOT com
Subject: Re: launch windows program from shell according to its extension
In-Reply-To: <sq0ea11hv6jnomcj848i6pjhchlrcupadc@4ax.com>
Message-ID: <Pine.GSO.4.61.0506081055090.4945@slinky.cs.nyu.edu>
References: <sq0ea11hv6jnomcj848i6pjhchlrcupadc AT 4ax DOT com>
MIME-Version: 1.0

On Wed, 8 Jun 2005, zzapper wrote:

> On Wed, 08 Jun 2005 09:23:53 -0400,  wrote:
>
> >At 03:45 AM 6/8/2005, you wrote:
> >>Hello,
> >>
> >>I have largely replaced usage of windows explorer with a cygwin shell.
> >>One thing is cumbersome however: when I encounter, say, a .doc file in
> >>a directory, it would be nice that I could "launch" this file with the
> >>program associated under windows.
> >>
> >>Is this possible, for example via a utility program kind of "launch
> >>file.doc"?
> >
> >Sure.  Use 'cygstart'.
>
> script to launch most recent file
>
> #!/bin/bash
> # csn
> # description : launch most recent file (head)
> # set -x
> cygstart $(l\s -t * | head -1) &

Make that 'cygstart "$(/bin/ls -t | head -1)"' (add quotes, otherwise
filenames with spaces will not work).

> Jump back into explorer in CURRENT directory
>
> wexp () {
>         XPATH="$(cygpath -w "${PWD}")"
>         explorer $XPATH
> }

You could've used "$(cygpath -aw .)".  And you need to quote $XPATH (i.e.,
use 'explorer "$XPATH"'), for the same reasons (spaces).

Besides, how about simply 'cygstart .'?

> man cygstart
> man cygpath

HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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