Hi,
I'm pretty new to bash, but I have the following script that does a simple operation: copying a folder.
In shell, I would type sudo macaco NewFolder
and this is the bash script:
#!/bin/bash
wwwPATH="/var/www"
bitMotorVERSION="0.0.0"
targetDir="$wwwPATH/$1"
cp -r /var/fw/bitMotor/$bitMotorVERSION/ $targetDir
This works fine! Now I want the script to output a little status message, and I 'm having problem with conditions. This is what I got so far:
if [ cp -r /var/fw/bitMotor/$bitMotorVERSION/ $targetDir ]
then echo "New Project '$1' Successfully Created!"
else echo "Something wrent wrong"
fi
Shell says: /usr/bin/macaco: line 7: [: too many arguments
What am I doing wrong?