delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/02/25/00:31:45

X-Spam-Check-By: sourceware.org
Date: Sat, 25 Feb 2006 00:31:25 -0500 (EST)
From: Igor Peshansky <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Michael Banks <chartpacs AT mac DOT com>
cc: cygwin AT cygwin DOT com
Subject: Re: [Newbie] Opening Files in a Folder
In-Reply-To: <2124967.1140838877859.JavaMail.chartpacs@mac.com>
Message-ID: <Pine.GSO.4.63.0602250021180.13725@access1.cims.nyu.edu>
References: <2124967 DOT 1140838877859 DOT JavaMail DOT chartpacs AT mac DOT com>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
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

On Fri, 24 Feb 2006, Michael Banks wrote:

> Hello,

Hi.  <http://cygwin.com/acronyms/#PCYMTWLL>.  Thanks.

> Suppose I have a folder on the desktop that contains a number of files.
> I would like to select only the .jpg files and then open them in a) a
> particular app if possible, or b) whatever app is associated with the
> .jpg extension.
>
> I think the syntax would look like:
>
> find "C:/path/to/desktop/images" -iname "*.jpg" -print0 | xargs -0 <some command to open these files>
>
> I don't know what should be substituted for <some command to open these
> files>. Any ideas?

"cygstart" for b).  But you'd need to change your command line to

find "C:/path/to/desktop/images" -iname "*.jpg" -print0 | \
  xargs -r0 -n1 cygstart

If you want to do a) (i.e., open the files in a given application), most
of the time you can simply supply the filenames to the application, after
putting them in Windows form, i.e.,

find "C:/path/to/desktop/images" -iname "*.jpg" -print0 | \
  xargs -r0 cygpath -aw | xargs -r -d'\n' your_app

Depending on whether your_app is able to accept multiple files at once,
you may or may not want to add "-n1" to xargs...
HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"

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