![]() |
Sudden Problem Started using cp: command "omitting directory"
Hi All,
Thanks in advance to anyone that can help me with this one...:) Just today, I'm having problems using the cp: command: 1. Suddenly, -i (interactive) is forced upon me, even if I didn't call for it. 2. If I use " -f ", I get an interactive prompt. 3. I get directory not found, or "directory omitted" for the following commands, that * worked fine * up until today: Code:
find /var/www/web1*/web/bmres*/myfolder/ -maxdepth 1 -type d | awk '{print "cp -f -R /home/searchfeed.php "$1"/"}' | /bin/shCode:
Code:
Code:
What's up, these commands worked fine a few days ago! :confused: |
Quote:
Quote:
|
I get that error in the first script with I listed containing the "awk" command
Hi Falko,
Thanks for your reply. I get that error in the first script I mentioned, the one containing the "awk" command... I want to use wildcards because I have many folders and divided into various sections throughout each "web1*" designation.... I'm not sure why this is suddenly happening - I had no troubles before yesterday! |
Quote:
|
Here's the code bit
Hi Falko,
Here's the code.... note, I use various iterations of it, such as web2*, web3*, etc because of the extreme amount of folders and sites on my server... Code:
find /var/www/web1*/web/site*/myfolder/ -maxdepth 1 -type d | awk '{print "cp -f -R /home/searchfeed.php "$1"/"}' | /bin/shTHANKS!:cool: |
Why do you pipe the output of the command through /bin/sh? :confused:
|
I borrowed this code piece from another script I saw
Hi Falko,
I found this code originally from another shell script on the web. I just tried running it without the | /bin/sh and the shell showed the cp command, but nothing was actually copied... The output was like the following: Code:
cp -f /home/searchfeed.php /var/www/web35/web/site_source_aaaafa4/myfolderI'm hesitant to do this only because I don't want to accidentally erase other files......:confused: |
Can you post your full script here, not just an excerpt?
|
Here's the code
Hi Falko,
This is the full code: Code:
## |
Please put
Code:
#!/bin/bash |
| All times are GMT +2. The time now is 14:11. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.