When running a bash script i get the following error:
./hi.sh: line 19: syntax error: unexpected end of file
Here is my code:
#!/bin/bash
#Remove unauthorized users
for line in ./unauthorized_users.txt; do
sudo userdel $line -y
sudo rm -rf "/home/$line" -y
#Remove unauthorized packages
for line in ./bad_packs.txt; do
sudo apt-get remove $line -y
sudo apt-get purge $line -y
Please advise me on what to do.
forloops withdone.sudo...$lineis not empty ([ "$line" ]), before you dosudo rm -rf "/home/$line" -y.