I have inherited code from a former employee and I need to identify the scripts he disabled with exit 0
at the top.
If I do head -2 load_db.ksh | tail -1 | grep hello
on a script, this works fine. I see the exit 0
statement at the second line of the script.
How can I automate this for nearly 900 scripts? I tried using find but it errs out
find . -name "*.ksh" -exec head -2 '{}' | tail -1 |grep exit \;
grep: ;: No such file or directory
find: missing argument to -exec
I cannot find the error in my syntax.