0

So I need to run one script, and I just drag & drop it to console, but console outputs this error:

matas@H81M-D2V:~/Desktop/gui$ '/home/matas/Desktop/gui/load.sh' 
bash: /home/matas/Desktop/gui/load.sh: /bin/bash^M: bad interpreter: No such file or directory
matas@H81M-D2V:~/Desktop/gui$ ^C
matas@H81M-D2V:~/Desktop/gui$ ^C
matas@H81M-D2V:~/Desktop/gui$ 

The script:

#!/bin/bash
if [[ $(nvidia-settings -q '[gpu:0]/DigitalVibrance[DFP-1]' | grep 'Attribute.*1023\.') ]]
then
    nvidia-settings -a '[gpu:0]/DigitalVibrance[DFP-1]=0' > /dev/null
    echo "Vibrance Disabled"
else 
    nvidia-settings -a '[gpu:0]/DigitalVibrance[DFP-1]=1023' > /dev/null
    echo "Vibrance Enabled"
fi
Jos
  • 29,224

1 Answers1

2

You have unsupported line breaks, likely from a Windows text editor. The easiest way to fix this is to install dos2unix and convert the file:

apt-get install dos2unix
dos2unix -n load.sh newload.sh
Tim H.
  • 66