in unix FOR LOOP showing syntax error (error token is "<") in unix FOR LOOP showing syntax error (error token is "<") unix unix

in unix FOR LOOP showing syntax error (error token is "<")


Enclose command with $(...)

z=$(wc -l temp.txt | cut -d " " -f1)


Since error is on line 5 so please change following in your script:

z=$(wc -l temp.txt | cut -d " " -f1)