Suppose I have one file input.txt in which the data is written each in new line like
JAVA
PERL
I have written one shell script which will read the file content line by line and then create the folder with the name written in the file and .As I need to do some other action on the basis of content read from the file also ,so I put if condition.
#!/bin/sh
while read -r line
do
if [[$line=="JAVA"]];then
cd /tmp/Repo
mkdir $line
*some copy command*
fi
if [[$line=="PERL"]];then
cd /tmp/Repo
mkdir $line
*some copy command*
fi
done < input.txt
But I am getting the below error as mentioned:-
./files.sh: line 4: [[JAVA==JAVA]]: command not found
./files.sh: line 4: [[PERL==JAVA]]: command not found
Can anyone please help me in debugging the shell script what should be the correct syntax .