X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Matthias Meyer Subject: read file with windows filenames Date: Thu, 29 Jan 2009 17:00:02 +0100 Lines: 34 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.10.9 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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, I want to read filenames from a file and manipulate this files with the windows program "attrib". Not easy to find how to read windows filenames from a file without lost of "\". while IFS= read -r cLine do echo "$cLine" done < restoreFiles.tmp The above will work. BUT: while IFS= read -r cLine do echo "$cLine" attrib +H "$cLine" done < restoreFiles.tmp rm -f restoreFiles.tmp will stop the while loop after the first call of attrib: + echo 'C:\Dokumente und Einstellungen\Administrator\Anwendungsdaten\Microsoft\Credentials\S-1-5-21-1606980848-1532298954-1801674531-500' C:\Dokumente und Einstellungen\Administrator\Anwendungsdaten\Microsoft\Credentials\S-1-5-21-1606980848-1532298954-1801674531-500 + attrib +S 'C:\Dokumente und Einstellungen\Administrator\Anwendungsdaten\Microsoft\Credentials\S-1-5-21-1606980848-1532298954-1801674531-500' + IFS= + read -r cLine + test 0 -gt 0 + rm -f restoreFiles.tmp Did anyone know what happens there? Thanks for any hint Matthias -- Don't Panic -- 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/