2

Im having a problem with my xubuntu script. This is the script:

#!/bin/bash/
cd /
touch ~/.config/zoomus.conf
cd ~/Desktop
'home/oem/Desktop/Zoom.desktop'

This is my error:

bash: ./zoom.sh: /bin/bash/^M: bad interpreter: Not a directory

Please help me fix this. Im writing the script bc zoom wont run on here without the terminal. So im writing the script.


this is another error:

/home/oem/Desktop/Zoom.desktop: line 1: [Desktop: command not found
/home/oem/Desktop/Zoom.desktop: line 3: Video: command not found
/home/oem/Desktop/Zoom.desktop: line 4: fg: no job control
/home/oem/Desktop/Zoom.desktop: line 9: Application: command not found
/home/oem/Desktop/Zoom.desktop: line 11: x-scheme-handler/zoomus: No such file or directory
/home/oem/Desktop/Zoom.desktop: line 11: x-scheme-handler/tel: No such file or directory
/home/oem/Desktop/Zoom.desktop: line 11: x-scheme-handler/callto: No such file or directory
/home/oem/Desktop/Zoom.desktop: line 11: x-scheme-handler/zoomphonecall: No such file or directory
/home/oem/Desktop/Zoom.desktop: line 11: application/x-zoom: No such file or directory
/home/oem/Desktop/Zoom.desktop: line 12: X-KDE-Protocols=zoommtg: command not found
/home/oem/Desktop/Zoom.desktop: line 12: zoomus: command not found
/home/oem/Desktop/Zoom.desktop: line 12: tel: command not found
/home/oem/Desktop/Zoom.desktop: line 12: callto: command not found
/home/oem/Desktop/Zoom.desktop: line 12: zoomphonecall: command not found
Thomas Ward
  • 78,878
pugking
  • 21

1 Answers1

8

You have two problems: (1) Carriage returns, and (2) incorrect paths.

Carriage Returns

Your script has extra carriage returns which are messing up handling of the script, because the system is trying to execute /bin/bash^M directly - which doesn't exist, because it can't; ultimately this is because you edited the script in Windows or wrote it in Windows. This is commonly the case when you use Windows to make/edit Linux scripts. So, don't create scripts in Windows that you intend to use on Linux.

That said, you can fix the problem.

Per this post on our sister site Unix and Linux you should try this specific solution:

  • Use dos2unix to format the file better.

    1. Use dos2unix /path/to/script
    2. If that doesn't work, use dos2unix -c mac /path/to/script

At least one of these solutions should remove the ^M carriage returns from the script and it SHOULD then work as expected.

Fix your paths

After you fix the carriage returns, /bin/bash is your executable, it's not a directory. So your shebang line should be: #!/bin/bash


As for your Desktop errors (which needed to be added as an edit!):

use exo-open /home/oem/Desktop/Zoom.desktop to open the Desktop launcher file.

Thomas Ward
  • 78,878