I'm trying to make a Linux shell script with find one or more director(y)ies which are not writeable by a specific user (envadmin).
I think I have to combine these two parts:
# Part 1 - this not complete right because I need if not true that the dir is not writeable and the owner is envadmin:
find -type d -maxdepth 1 ! -writable -user envadmin # I know, this is not working by '! - writable'
# Part 2 - at the if I should need part 1 I think:
for directory in *
do
if [ $directory -user envadmin ] ; then
if [ ! -w $directory ] ; then
echo "De directory: $directory is from envadmin but not writeable"
fi
fi
done
I have tried more but I hope that I have explained it right what I want and I hope that someone can put me in the right direction.