delorie.com/archives/browse.cgi | search |
X-Spam-Check-By: | sourceware.org |
Message-ID: | <450949CF.5050306@cc.uoi.gr> |
Date: | Thu, 14 Sep 2006 15:23:43 +0300 |
From: | "Nikolaos A. Patsopoulos" <npatsop AT cc DOT uoi DOT gr> |
User-Agent: | Thunderbird 1.5.0.5 (Windows/20060719) |
MIME-Version: | 1.0 |
To: | cygwin AT cygwin DOT com |
Subject: | add folder name to filename |
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 |
Hi, I have the following structure of folders and files: .. folder1 file1 file2 folder2 file1 file2 ..... and want to add the folder name into the filename: folder1 folder1_file1 folder1_file2 folder2 folder2_file1 folder2_file2 I used the following script but doesn't work under cygwin: for file in folder*/*; do dir=$(basename $(dirname $file) ) base=$(basename $file) mv $file $(dirname $file)/${dir}_${base} done Does anyone has a suggestion or where I should look? Thanks in advance, Nikos -- 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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |