I am converting a one-line script from csh to bash. The script simply removes a directory as specified by an argument on the command line.
cleanup.sh:
#!/bin/sh
find $1/testdir -exec rm -Rf {} +
works perfectly.
The following - cleanup.bash:
#!/bin/bash
find $1/testdir -exec rm -Rf {} +
results in the following error
$ bash cleanup.bash directory1
find: paths must precede expression:
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
Been racking my brains trying all sorts of things for a day now with suggestions from google. Please note - from the command line, this works perfectly. Just does not run inside bash script.