I am trying to clean some files with the help of find command but getting a strange error in the below scenario.
#!/bin/bash
find . -type f -newermt 2011-01-01 ! -newermt 2012-01-01 -exec truncate -s 0 {} \;
Works fine without any error. But when i put a simple completion message throws the below error.See the code below
#!/bin/bash
find . -type f -newermt 2011-01-01 ! -newermt 2012-01-01 -exec truncate -s 0 {} \;
echo "completed"
Is there any syntax error i am making.
find . -type f -newermt 2011-01-01 ! -newermt 2012-01-01 -exec truncate -s 0 {} \; ; echo "Hello"(or)find . -type f -newermt 2011-01-01 ! -newermt 2012-01-01 -exec truncate -s 0 {} \; && echo "Hello"