WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Bash script, TCL 9.0, unable to execute, No such file or directory  (Read 3550 times)

Offline rhermsen

  • Wiki Author
  • Full Member
  • *****
  • Posts: 109
Hi all,

Just to get my findings confirmed.
And maybe other scripts have the same mistake I made.


With TCL8.2.1 I was able to start a bash script which has an header #!/bin/bash (sha-bang). Even if I I'm using GNU Bash, the script is executed.

Code: [Select]
$ sudo /usr/local/etc/init.d/frr
Usage: /usr/local/etc/init.d/frr {start|stop|status|restart|force-reload|<priority>} [daemon] [instance]
       E.g. '/usr/local/etc/init.d/frr 5' would start all daemons with a prio 1-5.

$ head -n 2 /usr/local/etc/init.d/frr
#!/bin/bash
#

$ which bash
/usr/local/bin/bash

$ ls -la /bin/bash
lrwxrwxrwx    1 root     root            19 Apr  3 20:48 /bin/bash -> /usr/local/bin/bash

$ version
8.2.1


With TCL9.0 I used the same bash script (same header #!/bin/bash).

Code: [Select]
$ sudo /usr/local/etc/init.d/frr
sudo: unable to execute /usr/local/etc/init.d/frr: No such file or directory

$ head -n 2 /usr/local/etc/init.d/frr
#!/bin/bash
#

$ which bash
/usr/local/bin/bash

$ ls -la /bin/bash
ls: /bin/bash: No such file or directory

$ version
9.0

So the header of bash scripts need to change to:
#!/usr/local/bin/bash


Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11631
Re: Bash script, TCL 9.0, unable to execute, No such file or directory
« Reply #1 on: April 03, 2018, 09:53:32 PM »
Hi rhermsen
... So the header of bash scripts need to change to:
#!/usr/local/bin/bash
No, it sounds like there might be a problem with the startup script for bash. What do you get for the following command:
Code: [Select]
cat /usr/local/tce.installed/bash

Offline rhermsen

  • Wiki Author
  • Full Member
  • *****
  • Posts: 109
Re: Bash script, TCL 9.0, unable to execute, No such file or directory
« Reply #2 on: April 04, 2018, 03:23:57 PM »
Hi Rich,

Thanks for your reply. So there should be a symlink installed /bin/bash pointing to /usr/local/bin/bash


Code: [Select]
$ cat /usr/local/tce.installed/bash
$

Code: [Select]
$ ls -la /usr/local/tce.installed/bash
-rwxrwxr-x    1 root     staff            0 Apr  4 19:14 /usr/local/tce.installed/bash
$

Code: [Select]
$ which bash
/usr/local/bin/bash
$

Code: [Select]
$ bash --version
GNU bash, version 4.4.12(1)-release (i486-pc-linux-gnu)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$

Code: [Select]
$ version
9.0
$


Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11631
Re: Bash script, TCL 9.0, unable to execute, No such file or directory
« Reply #3 on: April 04, 2018, 04:20:00 PM »
Hi rhermsen
... So there should be a symlink installed /bin/bash pointing to /usr/local/bin/bash
Yes, that is correct. According to this the startup script is missing:
http://tinycorelinux.net/9.x/x86/tcz/bash.tcz.list

Based on this list from TC8:
http://tinycorelinux.net/8.x/x86/tcz/bash.tcz.list
The following files appear to be missing:
Code: [Select]
/usr/local/share/bash/.bashrc
/usr/local/share/bash/bashrc
/usr/local/tce.installed/bash

I will bring it to Juanitos attention.

This affects x86 and x86_64.
« Last Edit: April 04, 2018, 07:55:01 PM by Rich »

Offline rhermsen

  • Wiki Author
  • Full Member
  • *****
  • Posts: 109
Re: Bash script, TCL 9.0, unable to execute, No such file or directory
« Reply #4 on: April 04, 2018, 05:26:53 PM »
Thanks for looking into this.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: Bash script, TCL 9.0, unable to execute, No such file or directory
« Reply #5 on: April 05, 2018, 02:05:13 AM »
bash extensions reposted in the x86 and x86_64 repos - thanks for reporting this

Offline rhermsen

  • Wiki Author
  • Full Member
  • *****
  • Posts: 109
Re: Bash script, TCL 9.0, unable to execute, No such file or directory
« Reply #6 on: April 05, 2018, 09:12:58 AM »
Confirmed, bash script starts normally now. Tested on TCL x86.

Thanks.