have written a simple shell script to do some automation work. Basically the script searches for all the files in the current path and if the file is a specified one, it does some action. Below are the relevant lines ---
#!/bin/bash
1.for i in ls *
2.do
3.if [$i =="ls.sh"]
4.then .... //do something 5.fi 6.done
However, the string comparision in line 3 is not working and I am getting this when I run the script --
./ls.sh: line 3: [scripth.sh: command not found
./ls.sh: line 3: [scripth.sh~: command not found
./ls.sh: line 3: [test.sh: command not found
What is the correction to be done ?