I have a script "fd.sh"
./fd.sh $1 never fails
Below is the script:
/~ 2 07:53 AM :> cat fd.sh
#!/bin/bash
echo -e '\n'
find . -maxdepth 3 -iname "$1.*" -type f -exec wc -c "{}" ;
My alias in bash_aliases is
fdx='find . -maxdepth 3 -iname "$1.*" -type f -exec wc -c "{}" '
When I run the alias looking for all files from my home directory with the string "WORK", I get the message below:
/~ 1 07:51 AM :> fdx WORK
find: paths must precede expression: WORK
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
/~ 1 07:51 AM :>
It appears to me the two commands are identical, but only the script works, meaning I have to copy the script to parent directory of the folder I am searching. Cannot search in / as that would take days. Leaving my little find scripts all over the servers would also make the admins very unhappy
THX.