delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/06/29/04:13:51

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: <01C10039.AA80FB00.jorgens@coho.net>
From: Steve Jorgensen <jorgens AT coho DOT net>
Reply-To: "jorgens AT coho DOT net" <jorgens AT coho DOT net>
To: "cygwin AT cygwin. Com (E-mail)" <cygwin AT cygwin DOT com>
Subject: Not working: find . -lname ".*" -print
Date: Fri, 29 Jun 2001 01:20:01 -0700
X-Mailer: Microsoft Internet E-mail/MAPI - 8.0.0.4211
MIME-Version: 1.0

I'm trying to write a script that, for each symlink in a tree, outputs a 
line to another script file to recreate the symlink, then removes the 
symlink.  I started playing with find on my Linux system, and was able to 
get a list of symlinks in a tree using

find . -lname ".*" -print

I see that using -printf, instead, I can get it to generate anything I 
could need.  Anyway, I start up my Cygwin bash prompt, cd /bin where I know 
there are symlinks, and type the same line, but I get no output.  If I 
enter a known link destination instead of .*, then it works

$ find /bin -lname "unzip.exe" -print
/bin/zipinfo.exe

So it looks like find sees the symlinks just, but it's not handling the .* 
regular expression properly.  Is this a problem with me or with find?  I 
know it's not the quotes because it gives an error on either Linux or 
Cygwin without them.  I assume that means the shell is expanding it before 
find gets it in that case.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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