I have to make a bash script: I've a directory and I'm reading all the files that are in the directory and I have to find the files to which the members of the group have no rights, after all this files I have to put into another file and set the write right (w) to the members of the group (g).
I figured out how to find the files where members of the group have no rights, but I don't know how to put the files into another file and set the writing right to the members of the group. Can somebody help me?
I write echo `find $1 ! -perm /g=rwx`
just to see if the files are correctly taken.
#!/bin/bash
if [ $# -eq 0 ]
then echo "Nu exista parametri"
exit 1
fi
if [ ! -d $1 ]
then echo "It's not a directory" #Check if the parameter is a directory
exit 1
fi
echo `find $1 ! -perm /g=rwx`