delorie.com/archives/browse.cgi | search |
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: | <20000814180600.7804.qmail@web121.yahoomail.com> |
Date: | Mon, 14 Aug 2000 11:06:00 -0700 (PDT) |
From: | Earnie Boyd <earnie_boyd AT yahoo DOT com> |
Subject: | Re: linux bash compatibility |
To: | Steven Boothe <stevenb AT visualpurple DOT com>, cygwin AT sources DOT redhat DOT com |
MIME-Version: | 1.0 |
--- Steven Boothe <stevenb AT visualpurple DOT com> wrote: > Hello and greetings to the list: > > I am trying to find a cross-platform script that will rename file extensions > for me. So far I have had some help finding a script that will work in the > Linux bash environment, but it won't under the win98/cygwin bash shell...? > What it does under win98/cygwin is rename the first file that matches the > pattern and changes its' from "filename.htm" to "$.bar". > > Can anyone help me find a way to implement this script so that it will work > under cygwin / win98? > > Here is the contents of the script I am currently working with: > > for i in `ls -1 *.htm | cut -d. -f1`; > do mv $i.htm $.bar; > done > > I guess to put it another way: "How come this works under Linux and not > win98?" > Or, why is it wrong on Linux? Look at your script again. You've told it to rename the file to $.bar and not $i.bar!! This should create the file $.bar for every occurance of $i.htm and you should end up with just one file named $.bar with the contents of the last $i.htm. Cheers, ===== --- Earnie Boyd: <mailto:earnie_boyd AT yahoo DOT com> __Cygwin: POSIX on Windows__ Cygwin Newbies: <http://gw32.freeyellow.com/> __Minimalist GNU for Windows__ Mingw32 List: <http://www.egroups.com/group/mingw32/> Mingw Home: <http://www.mingw.org/> __________________________________________________ Do You Yahoo!? Yahoo! Mail – Free email you can access from anywhere! http://mail.yahoo.com/ -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |