| delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| X-SWARE-Spam-Status: | No, hits=0.2 required=5.0 tests=AWL,BAYES_00,TW_NX,T_RP_MATCHES_RCVD |
| X-Spam-Check-By: | sourceware.org |
| From: | "Dhondt, Edwin" <edwin DOT dhondt AT hp DOT com> |
| To: | "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com> |
| Date: | Tue, 25 May 2010 11:21:08 +0000 |
| Subject: | Executing bash script in cygwin to test correctness ? |
| Message-ID: | <D24592522799DC49BEC35AAA2F5BF0BF5466470AE5@GVW1120EXC.americas.hpqcorp.net> |
| MIME-Version: | 1.0 |
| X-IsSubscribed: | yes |
| 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 |
Can I use cygwin to test whether a bash script is correct and therefore whe=
ther it will function on the eventual real target "unix" production platfor=
m ?
E.g. (see below), I've got a configuration file and a shell script (that's=
referencing the configuration file).
Will I be able to execute the xyz.sh script in cygwin on WinXP without havi=
ng to change the filepath of the X_DIR variable ?
That is will I be able to use cygwin on winxp to fully test the script so t=
hat I'm sure it will run without any problems on the eventual real target u=
nix platform ?
Thanks
EDH
myconf.conf file:
X_DIR=3D/export/opt/SUNWappserver8/domains/x-batchv
X_LOG=3D$X_DIR/logs/x/batchflows/batchscripts.log
xyz.sh file:
#!/bin/bash
CONFIG_FILE=3D`dirname $0`/myconf.conf
. $CONFIG_FILE
function add_log_entry
{
if [ ! -d "`dirname $X_LOG`" ]
then
echo "`dirname $X_LOG` does not exist, it will be created"
mkdir -p "`dirname $X_LOG`"
fi
pre=3D"`date` :"
echo "$pre $1" >> $X_LOG
echo "$pre $1"
}
--
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 |