X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:from:to:subject:date:message-id:references
	:in-reply-to:content-type:content-transfer-encoding
	:mime-version; q=dns; s=default; b=PUi6hmLTFXpYnIgM+N6yDCGLdgwJA
	gR+FSqQrqvB4ubo6uOfbl3EPQMN3k15RaovfzYmLDCl2+j0V3XGfnj3VZu8Ni3Ke
	0FDPURq1tw+u9kUvf7uhkxsxHcacm2/zyO92eq4RnvwbYhTcAGCNRd16y7yanU4v
	yGgMie+Drcx22E=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:from:to:subject:date:message-id:references
	:in-reply-to:content-type:content-transfer-encoding
	:mime-version; s=default; bh=Xy/0+G5EwePnvSoUxWiNiNIpGE8=; b=WK6
	yxiGFIv1cGuPeXOswpGU29Fi4k3HncqqytlV2bys3JzeSv+HkIbQbWhzr1n3oltz
	+ou5pnCJ809Wzf3BXfD0nbpredXmCSgaLjrbAnwXHxOHpuaJ7yTbdAF99agL8dDX
	rKGfti5ASNxTEvKgfLnRPEDeRyVkmna/XEmORHKM=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_MED,RCVD_IN_HOSTKARMA_NO autolearn=ham version=3.3.1
From: "Nellis, Kenneth" <Kenneth.Nellis@xerox.com>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: RE: Executing a script on Cron and produces ctrl-m
Date: Tue, 11 Jun 2013 12:49:39 +0000
Message-ID: <0D835E9B9CD07F40A48423F80D3B5A7021C57CD1@USA7109MB022.na.xerox.net>
References: <1370951350.13648.YahooMailNeo@web162104.mail.bf1.yahoo.com>
In-Reply-To: <1370951350.13648.YahooMailNeo@web162104.mail.bf1.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id r5BCoRxQ003139

-----Original Message-----
Subject: Executing a script on Cron and produces ctrl-m

Hi,

I would like to seek your help regarding the behavior of running a shell script manually and via cron in Cygwin.
I made a simple bash script that execute hostname command, assign it to a variable and write it on the logfile.

     xhostname=`hostname`
     echo "`date`| ${xhostname}*" >> /some/folder/logfile.log


When I manually execute the script, the expected output is ok.   But when I execute it via cron, it added a "Control-M" after it returned the hostname value.  May I know how I will address the issue?

----------end original message-----------

Because cron is executing the Windows version of hostname.
Type: which -a hostname
Check your $PATH.
--Ken Nellis

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


