I have an exe which takes 2 parameters both are csv as below splitline.exe /dir/file1.csv /dir1/file2.csv, this basically splits the lines in the input file to 2 lines in the output file.So,I wrote a shell script to execute this exe. the directory is fixed,but the filename can differ, both filename in src directory and destination directory should be same.I am running it on windows environment.It is having MKS installed,so unix and shell script also can be executed. Below is the code snippet which I wrote:
#!/bin/sh
srcdir='D:/srcdir/srcdir1/'
destdir='D:/destdir/destdir1/'
extension='csv'
srcfile='${srcdir}/*.csv'
if [[-f ${srcfile} in ${srcdir}]]
then
cSplit.exe "${srcdir}/{srcfile}.${extension}" "${destdir}/${srcfile}.${extension}"
mv "${srcfile}" "${srcdir}/old"
else
echo "no file"
fi
output: [[-f : splitty.sh 21 not found Its giving output as "no file" Please correct my mistake,as I am new to shell script