This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: Executing a script on Cron and produces ctrl-m
- From: "Nellis, Kenneth" <Kenneth dot Nellis at xerox dot com>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Tue, 11 Jun 2013 12:49:39 +0000
- Subject: RE: Executing a script on Cron and produces ctrl-m
- References: <1370951350 dot 13648 dot YahooMailNeo at web162104 dot mail dot bf1 dot yahoo dot com>
-----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