| delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT 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 AT cygwin DOT com; run by ezmlm |
| List-Id: | <cygwin.cygwin.com> |
| 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 |
| 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 DOT Nellis AT xerox DOT com> |
| To: | "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT 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 DOT 13648 DOT YahooMailNeo AT web162104 DOT mail DOT bf1 DOT yahoo DOT com> |
| In-Reply-To: | <1370951350.13648.YahooMailNeo@web162104.mail.bf1.yahoo.com> |
| MIME-Version: | 1.0 |
| 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
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |