WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline rhermsen

  • WikiUser
  • *
  • Posts: 20
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

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5998
Re: Bash script, TCL 9.0, unable to execute, No such file or directory
« Reply #1 on: April 03, 2018, 06: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

  • WikiUser
  • *
  • Posts: 20
Re: Bash script, TCL 9.0, unable to execute, No such file or directory
« Reply #2 on: April 04, 2018, 12: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

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5998
Re: Bash script, TCL 9.0, unable to execute, No such file or directory
« Reply #3 on: April 04, 2018, 01: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, 04:55:01 PM by Rich »

Offline rhermsen

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

Offline Juanito

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

Offline rhermsen

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

Thanks.