I have a file that looks like this
#!/bin/bash
find . -type f -exec chmod 644 {} \;
find . -type f -exec chown vagrant:www-data {} \;
find . -type d -exec chmod 755 {} \;
find . -type d -exec chown vagrant:www-data {} \;
let's assume it's called foo.sh
I'm on an Ubuntu 14.04 machine and i have root rights sudo su
before I execute it.
If I call sh foo.sh
the command line tells me:
# sh foo.sh
: not foundh: 2: foo.sh:
find: missing argument to `-exec'
find: missing argument to `-exec'
find: missing argument to `-exec'
find: missing argument to `-exec'
: not foundh: 7: foo.sh:
but when I run the 4 commands after each other directly from the command line, well then it works. Here's the question: What's wrong? And why is it complaining about line 2 and 7 (they are empty)
Thanks (: