“bad interpreter” error message when trying to run awk executable

后端 未结 2 1329
失恋的感觉
失恋的感觉 2021-01-20 00:37

I\'m trying to make an awk file executable. I\'ve written the script, and did chmod +x filename. Here is the code:

#!/bin/awk -v

\'TOPNUM = $1         


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-20 01:15

    Actually this form is more preferrable:

    #! /bin/awk -E 
    

    Man told:

    -E Similar to -f, however, this is option is the last one processed and should be used with #! scripts, particularly for CGI applications, to avoid passing in options or source code (!) on the command line from a URL. This option disables command-line variable assignments

提交回复
热议问题