I have the following bash script I'm now trying to convert to run using the system shell instead:
1 #!/bin/sh
2 #testtotal
3 lines="$(crontab -l | awk '{if(NR>2)print}')"
4 echo "1..$lines"
5 counter=1
6 while read p; do
7 if [[ -x "$p" ]]
8 then
9 echo "ok $counter - $p is executable"
10 else
11 echo "not ok $counter - $p is not executable or found"
12 fi
13 counter=$((counter+1))
14 done < <(crontab -l | awk '{if(NR>2)print}' | awk '{print $6}')
when I run using "sh" it fails with the error:
ctest: line 14: syntax error: unexpected redirection
Can you tell me how to adapt this to run under bin/sh?
<<instead of< <. Spaces do matter.crontab -l | awk 'NR > 2 {print $6}'using only one awk