I have this script shell and i want to execute it in windows:
#!/bin/sh
# Create the structure of folders that will contain the result files
export perl_git_dir=path1
export OUTPUT_DIR=path2
mkdir $OUTPUT_DIR/output_perl
for FILE in `ls *.sh`
do
echo "file is:"$FILE
if [ -f "$FILE" ];then
name=${FILE%.*}
mkdir -p $OUTPUT_DIR/output_perl/"$name"
fi;
done
for entry in `ls *.sh`
do
if [ -f "$entry" ];then
echo "enty is "$entry
echo "$entry" >> stdout.txt
echo "$entry" >> stderr.txt
./$entry >> stdout.txt 2>> stderr.txt
fi;
done
the result that I have is: the creation of the direcory then this repetitive error in "stderr.txt" file
mkdir: cannot create directory ‘path1/output_perl’: File exists
for FILE in `ls *.sh`; doinstead of file globbing, i.e.for FILE in *.sh; do?${OUTPUT_DIR}/output_perl/${basename}. It seems unused, e.g. the scripts are not executed in its directory.