This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Executing bash script in cygwin to test correctness ?
- 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 ?
Can I use cygwin to test whether a bash script is correct and therefore whether it will function on the eventual real target "unix" production platform ?
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 having 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 that I'm sure it will run without any problems on the eventual real target unix platform ?
Thanks
EDH
myconf.conf file:
X_DIR=/export/opt/SUNWappserver8/domains/x-batchv
X_LOG=$X_DIR/logs/x/batchflows/batchscripts.log
xyz.sh file:
#!/bin/bash
CONFIG_FILE=`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="`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