New to korn shel1 and having an issue. The following is suppose to read the parameter values from files in a source directory and then pass them on to a log file in a different directory, The ArchiveTracker scripts is suppose to call the parameterreader script to exact the parameter values and pass them on to a log file.
But I keep getting the following when I run the script.
-bash: ./: is a directory
code
#/bin/ksh
#ArchiveTracker
SourceLocation='pwd'
TrackerLocation=~/Scripts/Test/Tracker
LOGFILE=$TrackerLocation/processing.log
rm -f $LOGFILE
touch $LOGFILE
for sfile in $SourceLocation/*
do
if [ ! -s "$SourceLocation/$file" ];
then
echo Step 2: Processing $file >> $LOGFILE
while read line < $file
do
PARNAME=`echo $line | awk -f "=" '{print $1}'`
PARVALUE`parameterreader $file $PARNAME`
echo file $PARNAME >> LOGFILE
done
sftp -p "$SourceLocation/$file $TargetLocation/$file"
ret_code=$?
if [$ret_code != 0]; then
printf "error : [%d] when executing command:" $ret_code
#exit $ret_code
else
echo Step 3: Writing $TrackerLocation/$file
touch "$TrackerLocation/$file"
fi
else
echo Step 2: $file previously processed
fi
done
code
code
#/bin/ksh
#parameterreader script
PARVALUE=`grep $2 $1 | awk -f "=" '{print $1}'`
echo $PARVALUE
code