find: paths must precede expression: How do I specify a recursive search that also finds files in the current directory?
Try putting it in quotes -- you're running into the shell's wildcard expansion, so what you're acually passing to find will look like:
find . -name bobtest.c cattest.c snowtest.c
...causing the syntax error. So try this instead:
find . -name '*test.c'
Note the single quotes around your file expression -- these will stop the shell (bash) expanding your wildcards.
find: paths must precede expression
Quote your shell arguments:
$ ./findfiles.sh /var/log/ '*.txt'
Why does find command in if return paths must precede expression error?
The problem are the date variables - and if you had read find
's output correctly you would have noticed that, too.
if test -n "$(find . -iname 'PAY*.txt' -newermt "$p_date1" ! -newermt "$p_date2" -print)";
Note the double quotes around the variable names.
find: paths must precede expression: find -name
ssh
uses system(3)
semantics and not execve(2)
semantics.
In other words, you need to add a layer of escaping:
sshpass -p bagabu ssh -q root@localhost "find /opt/ -iname '*.log*'"
find: paths must precede expression: `1'
That error is shown when a stray argument is found on the command line, which is 1
in this case, as -d
(i.e -depth
) doesn't take an argument. However, it seems that you don't need find
here at all.
for dir in ./*/; do
make -C "$dir" clean &&
make -C "$dir" &&
cp "$dir/main.bin" "$dir.bin" &&
make -C "$dir" clean
done
Related Topics
How to Redirect Output to a File and Stdout
How to Test If a Variable Is a Number in Bash
Glibc Scanf Segmentation Faults When Called from a Function That Doesn't Align Rsp
Sed In-Place Flag That Works Both on MAC (Bsd) and Linux
Simulate Delayed and Dropped Packets on Linux
The 'Eval' Command in Bash and Its Typical Uses
How to Parse Xml Using Shellscript
How to Change Permissions For a Folder and Its Subfolders/Files
How Does "Cat ≪≪ Eof" Work in Bash
Get Exit Code of a Background Process
What Is the Meaning of So_Reuseaddr (Setsockopt Option) - Linux
What Does the Number in Parentheses Shown After Unix Command Names in Manpages Mean
Bash Script Prints "Command Not Found" on Empty Lines
What Happens to an Open File Handle on Linux If the Pointed File Gets Moved or Deleted
Multiline Bash Command in Jenkins Pipeline
Error Starting Eclipse in Linux: "Jvm Terminated. Exit Code=13"