Why do I get 'syntax error near unexpected token' when running a standard Red Hat Support bash script?

Solution Verified - Updated -

Issue

  • There is the following error running the high_cpu_linux.sh script:
    $ ./high_cpu_linux.sh 29392
    : bad interpreter: No such file or directory
    $ sh ./high_cpu_linux.sh 29392
    : command not found: line 11: 
    : command not found: line 16: 
    '/high_cpu_linux.sh: line 17: syntax error near unexpected token `
    '/high_cpu_linux.sh: line 17: `for ((i=1; i <= $LOOP; i++))
    

Environment

  • Linux

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content