Problem with bash script
carmel_ny at hotmail.com
Tue Jun 16 14:54:24 UTC 2009
On Tue, 16 Jun 2009 15:56:15 +0200
Bertram Scharpf <lists at bertram-scharpf.de> wrote:
> Am Dienstag, 16. Jun 2009, 09:09:09 -0400 schrieb Carmel NY:
> > [...] It seems to work until I get to the copy part where it fails.
> > My scripting skills are not that good. Perhaps someone could tell me
> > what I am doing wrong.
> > # copy the file to another directory using the base name
> > cp $i /usr/home/tmp/$BN
> Please provide the error message next time.
> I guess the filenames contain spaces. Try
> cp "$i" "/usr/home/tmp/$BN"
I am an idiot. The problem was that the directory did not exist. It was
suppose to be "$HOME/tmp/$BN".
However, I rarely use find and was not aware of the '-exec' function. I
use that and it worked fine.
Thanks to everyone for their assistance.
More information about the freebsd-questions