Script showing bad interpreter and will not run

前端 未结 4 1650
星月不相逢
星月不相逢 2021-01-21 10:03

I was sent a perl script over mail and asked to run it .I placed it on my local drive as is but when I tried to run the script it shows me

/usr/bin/perl^M: bad          


        
4条回答
  •  离开以前
    2021-01-21 10:39

    Do this in vim:

    :%s/^M//g
    

    save the file and try running it again

    execute: vim

    when vim opens go to command mode by hitting the escape key .... at the command prompt (:) type: %s/^M//g. This will remove all "^M" characters from the file.

提交回复
热议问题