I am trying to write a bash script which takes a users home directory and cycles through the first level of subdirectories and performs some maintenance on those directories only if it is not the /Library or /Public folder. The code I have so far does not work as I get an error message saying that the directory name returned by $dir is a directory. Here is the code:

```
#!/bin/bash

user="short name"
source_root="/Users/"

source_use="$source_root$user"
cd "$source_use"

dirarr=( */ )

echo ${dirarr[@]}

for dir in "${dirarr[@]}"
do 
    if ( "$dir" -ne "/Library" -o "$dir" -ne "/Public")
        then echo $dir.
            # do something
    fi
done

```

Can anyone help me get this working.

Many thanks