-1

The first line of my script is

/usr/bin/mount /dev/sdb4 /media/user/Data

Running it I get

/home/patrick/Scripts/DataBackup.sh: 1: /home/patrick/Scripts/DataBackup.sh: /usr/bin/mount: not found

Even if I put sudo before the mount command it does not find sudo neither. Thank you for your help

Cyrus
  • 84,225
  • 14
  • 89
  • 153
Lucens
  • 1
  • 1

2 Answers2

2

Put this as your first line:

#!/bin/bash

The existing lines will appear after the 'shebang' line above.

Mike Slinn
  • 7,705
  • 5
  • 51
  • 85
0

Solved: using Libreoffice to write the script, bash gives a not found error on whatever was written on the first line.

Lucens
  • 1
  • 1
  • 1
    Libreoffice might be adding a [byte order mark](https://en.wikipedia.org/wiki/Byte_order_mark) at the beginning of the file (which will confuse anything that expects plain text). [This superuser answer](https://superuser.com/questions/345814/exporting-utf-8-text-from-libreoffice-without-byte-order-mark) suggests there should be a checkbox in the Save As dialog to control this. – Gordon Davisson Apr 17 '21 at 03:43