i have very simple shell script
#!/bin/bash
cp -rf /var/www/ksite/app2/* /var/www/ksite/app
echo "----"
echo "done"
but seems cp command fails
if i execute
cp -rf /var/www/ksite/app2/* /var/www/ksite/app
from terminal everything work ok. Can someone tell me how to include cp in shell script?
Thanks
We seem to have doubt as to how this script fails. If there is no error message then this is a strange one. I suggest:
which cp
cp
in the script (e.g. /bin/cp
)bash -x script-name
and see if you get what you expect.echo $?
after the copy in the script - if it is zero then it (thinks it) worked.ls -ld /var/www/ksite/app
from your script, maybe someone set a symbolic link? . script-name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With