X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Eric Blake Subject: Re: date generates a "\r" Date: Tue, 3 Feb 2009 17:16:23 +0000 (UTC) Lines: 23 Message-ID: References: <0A4ADB2148EA2948B9FFFB980FA0D22F0570B7B6 AT djexchange DOT dickey-john DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) 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 Arun Biyani dickey-john.com> writes: > [log$:513] name=$(date +tiny-%b-%d-%g) > [log$:514] bakup=$name.tz > > The assignments above result in bakup being > "/c/home/bak/tiny-Feb-02-g\r.tz". I'd like to understand why this > happens Please don't commandeer threads. The answer to your question is here: http://cygwin.com/ml/cygwin-announce/2008-11/msg00035.html not to mention that it is a FAQ on this list > when the script is being run from cron (but not when I run it in a bash > shell). Is the fix is to put "/usr/bin/date" instead of "date"? No, the fix is to quit using linefeeds in your script files unless you are willing to teach bash to ignore those line feeds. d2u is your friend. -- Eric Blake volunteer cygwin bash maintainer -- 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/