X-Spam-Check-By: sourceware.org Date: Sat, 16 Sep 2006 22:34:56 +1000 From: oleyk X-Mailer: The Bat! (v1.62r) Reply-To: oleyk Message-ID: <1472821029.20060916223456@mail.ru> To: cygwin AT cygwin DOT com Subject: Re[2]: add folder name to filename In-Reply-To: <45095465.9010507@cc.uoi.gr> References: <450949CF DOT 5050306 AT cc DOT uoi DOT gr> <45094B84 DOT 6010009 AT byu DOT net> <45094C90 DOT 3010804 AT cc DOT uoi DOT gr> <45094E89 DOT 8040000 AT byu DOT net> <45095465 DOT 9010507 AT cc DOT uoi DOT gr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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 Nikolaos NAP> Fixed : NAP> added a space after "folder": NAP> for file in folder */*; do ^^^^^^ NAP> echo folder */* NAP> dir=$(basename "$(dirname "$file")") NAP> base=$(basename "$file") NAP> mv "$file" "$(dirname "$file")/${dir}_${base}" NAP> done "Script started, file is typescript" -- "file" - reserved word hint: man file -- Regards, oleyk mailto:oleyk AT mail DOT ru -- 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/