The content of text file text.txt
DS/Apple
DS/Banana
DS/Strawberry
DS/Apple
DS/Orange
The code that I wrote :
for i in $(cat text.txt)
do
count = 0
for j in $(cat text.txt)
do
if [ i == j ]; then
count = count + 1
fi
done
if [ count < 2 ]; then
$i >> Final.txt
done
The error I am getting :
$ Trial.sh
./Trial.sh: line 12: syntax error near unexpected token `done'
./Trial.sh: line 12: `done'
I want the output without any duplicate lines in a new text file Final.txt
Where am I going wrong?