delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/06/08/11:18:54

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
To: cygwin AT cygwin DOT com
From: zzapper <david AT tvis DOT co DOT uk>
Subject: Re: launch windows program from shell according to its extension
Date: Wed, 08 Jun 2005 16:13:35 +0100
Lines: 40
Message-ID: <ki2ea11bf1n5985j6ksn9g25vi9v3m10dp@4ax.com>
References: <sq0ea11hv6jnomcj848i6pjhchlrcupadc AT 4ax DOT com> <Pine DOT GSO DOT 4 DOT 61 DOT 0506081055090 DOT 4945 AT slinky DOT cs DOT nyu DOT edu>
Mime-Version: 1.0
X-IsSubscribed: yes

On Wed, 8 Jun 2005 10:59:27 -0400 (EDT),  wrote:


>>
>> #!/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).

Slightly improved to ignore directories (and assuming that Windows files always have an extension)
cygstart "$(/bin/ls -t *.* | head -1)"

>
>> 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 .'?

Yep! good.

>> man cygstart
>> man cygpath
>


-- 
zzapper
vim -c ":%s%s*%Cyrnfr)fcbafbe[Oenz(Zbbyranne%|:%s)[[()])-)Ig|norm Vg?"
http://www.rayninfo.co.uk/tips/ vim, zsh & success tips


--
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