This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Executing a script on Cron and produces ctrl-m


-----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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]