I'm just starting with some scripts with the bash. Now I got the following errors:
- 0=1: command not found on line 9.
- Home * Error: command not found on line 17
I want to check with my script if the home-directory and later some other directories exist and have the right permission.
I have already searched with Google and on Stack Overflow but I didn't find an answer. First I had too many spaces between the variables and their assigned value. This error I think I fixed but still there are other errors for which I didn't find an answer.
Thanks for you help and here you can see my code from the script:
#!/bin/bash
users=(Hans Peter Alfred Georg Stefan Albert Christine)
for user in ${users[@]};
do
   nutzerVerzeichnis="0"
   if [ -d "/home/${user}" ]
   then
           ${nutzerVerzeichnis}="1"
           echo $home_dir
   fi
   if [ "${nutzerVerzeichnis}" -eq "1" ]
   then
           "Home ${user} ok">>/root/skript/permission.log
   else
           "Home ${user} Error">>/root/skript/permission.log
   fi
done
exit 0
 
     
     
    