I have a config file which contains path to a some files .
path.conf file
path=/home/work_group/Desktop/rt.txt
path=/home/test/
.... ....
path=/home/work_group/Documents/offdoc/
In a script i want to read all these file path and set permission to them. I tried the following code but it doesn't even print the path name.
#!/bin/bash
while IFS= read -r line || [[ -n "$path" ]]; do
if [ -n "$path" ]
then
echo "Text read from file: $path"
chmod 0750 $path
fi
path=
done < admin.cfg
can somebody help me to write a script which takes all the file paths mentioned in the config file and set their permissions to 0750.