I have a bash script and I want to check with an (el) if statement if a string is not in a file and then run an action
This is the part of the script:
elif [ "$(cat balance.txt)" -eq 250000000 ] && [ "$(find files/ -type f | wc -l)" -ge 5 ] && [ "$(grep -c "$(cat string.txt)" whitelist.txt)" -ge 1 ] && [ "$(grep -c "$(cat string.txt)" whitelist2.txt) " -eq 0 ] ;
then
sh result.sh
The first 2 parts of the elif statements are working but only the third part gives me problems:
[ "$(grep -c "$(cat string.txt)" whitelist2.txt) " -eq 0 ]
It skips this part and goes straight to the else part of the script which runs fine.
Does anybody maybe knows what I am doing wrong? Or what is should change?