I have cpanel set up on a redhat server and I am trying to execute a shell script that will take one file and copy this same file to multiple directories (hosting folders) in the same folder hierarchy. I tried to do this using a wildcard symbol * and instead of doing them all I was testing with all folders that start with an a (hence I used 'a*' in code)
Code:
Code:
#/bin/bash
for file in /home/cccarz/public_html/privacy-policy.php /home/a*/public_html
do
cp privacy-policy.php ${file}
done
When I executed this shell script I got these messages...
Code:
cp: cannot stat 'privacy-policy.php': no such file or directory
cp: cannot stat 'privacy-policy.php': no such file or directory
cp: cannot stat 'privacy-policy.php': no such file or directory
cp: cannot stat 'privacy-policy.php': no such file or directory
cp: cannot stat 'privacy-policy.php': no such file or directory
cp: cannot stat 'privacy-policy.php': no such file or directory
cp: cannot stat 'privacy-policy.php': no such file or directory
.............(it went on 17 lines for the 17 accounts)
What does this mean? Why did I get these messages? Did I put something in the wrong place in my code?