I have written a script that runs fine when I execute it, but when I tried to run it as a cronjob, I get a SyntaxError: invalid syntax
error.
The line in question is
folder=$(find $folder -maxdepth 1 -type d -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- d" ")
The caret (^
) sign that indicated where the error was was under the $
in folder=$(find
Why did I only get the error from the cronjob but not when I manually run the script?