|
Post by rikky on Sept 22, 2019 13:05:31 GMT 1
The workaround with bash -c doesn't work unfortunatly. I tried some figuring with other options, but to no avail.
But the changing of the symlink did. And Indeed, I cannot see any delay in the bootup time of the system. As fast as ever.
So, I changed the symlink. :-)
Thanks Rik :°)
|
|
|
Post by Pjot on Sept 22, 2019 13:12:01 GMT 1
The workaround with bash -c doesn't work unfortunatly. Weird, could be that you need to specify the full path, for example "/bin/bash" or so. Anyway, good to see that changing the symlink solved your issues BR Peter
|
|
|
Post by bigbass on Sept 22, 2019 16:32:58 GMT 1
Hello Peter ,vovchik and rikky Thanks for all the comments fixes and code!basic-converter.proboards.com/post/12486just some feedback and a summary from another raspberry pi bacon user The symlink is the fix! Now some feed back on bash -c the optional prefix bash -c works but chops off the complete version info in bash so it should be noted this is not the best option for all things on the raspberry pi but its good to have as another means of testing problems with the shell and that was the reason for the optional bash -c PRINT "BASHOPTS : " & CHOP$(EXEC$("bash -c \"echo $BASHOPTS\"")) PRINT "BASH_VERSINFO : " & CHOP$(EXEC$("bash -c \"echo $BASH_VERSINFO\"")) PRINT "EUID : " & CHOP$(EXEC$("bash -c \"echo $EUID\""))
TERMINAL OUT BASHOPTS : cmdhist:complete_fullquote:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath BASH_VERSINFO : 4 EUID : 1000
this is simple and works well as was posted earlier in this thread *and was the first working option given note :after the symlink was fixed ----------------------------------------- PRINT EXEC$("echo $EUID") PRINT EXEC$("echo $BASH_VERSION")
TERMINAL OUTPUT1000
4.4.19(1)-release ================================================================= if we get other raspberry pi users in the future (or I forget too after an update) the symlink fix is ================================================================ ls -l /bin/sh lrwxrwxrwx 1 root root 4 jun 8 10:10 /bin/sh -> dash #remove the symlink first sudo rm /bin/sh #make the symlink sudo ln -s /bin/bash /bin/sh #run the first command again and notice now you are using bash ls -l /bin/sh lrwxrwxrwx 1 root root 9 sep 22 09:35 /bin/sh -> /bin/bash --------------------------------------------------- #if for some reason you would like to return to dash #for testing the differences #remove the symlink sudo rm /bin/sh #make a new symlink to point to dash sudo ln -s /bin/dash /bin/sh
|
|
|
Post by rikky on Sept 22, 2019 22:43:34 GMT 1
The workaround doesn't work. And the link, works, if I do it in bash. I can :
sudo rm /bin/sh sudo ln -s /bin/bash /bin/sh ls -l /bin/sh lrwxrwxrwx 1 root root 9 Sep 22 23:32 /bin/sh -> /bin/bash From BaCon, I have to use the -f switch, Whether the symlink is to bash or dash, doesn't matter. Don't ask me why. The bright sight is, we can remove the 'rm'
So here is a new test program with a new workaround. (If for some reason you want to keep the dash shell) starting shell is dash :
'check SYSTEM "ls -l /bin/sh" PRINT
'workaround with bash -c PRINT "BASHOPTS : " & CHOP$(EXEC$("bash -c \"echo $BASHOPTS\"")) PRINT "BASH_VERSINFO : " & CHOP$(EXEC$("bash -c \"echo $BASH_VERSINFO\"")) PRINT "EUID : " & CHOP$(EXEC$("bash -c \"echo $EUID\"")) PRINT
'change shell to bash SYSTEM "sudo ln -fs /bin/bash /bin/sh"
'check SYSTEM "ls -l /bin/sh"
'workaround with bash -c PRINT PRINT "BASHOPTS : " & CHOP$(EXEC$("bash -c \"echo $BASHOPTS\"")) PRINT "BASH_VERSINFO : " & CHOP$(EXEC$("bash -c \"echo $BASH_VERSINFO\"")) PRINT "EUID : " & CHOP$(EXEC$("bash -c \"echo $EUID\""))
'without workaround PRINT PRINT "BASHOPTS : " & CHOP$(EXEC$("echo $BASHOPTS")) PRINT "BASH_VERSINFO : " & CHOP$(EXEC$("echo $BASH_VERSINFO")) PRINT "EUID : " & CHOP$(EXEC$("echo $EUID"))
'change back to dash SYSTEM "sudo ln -sf /bin/dash /bin/sh" And the output, in my case is:
lrwxrwxrwx 1 root root 9 Sep 22 23:45 /bin/sh -> /bin/dash
BASHOPTS : BASH_VERSINFO : EUID :
lrwxrwxrwx 1 root root 9 Sep 22 23:29 /bin/sh -> /bin/bash
BASHOPTS : cmdhist:complete_fullquote:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath BASH_VERSINFO : 4 EUID : 1000
BASHOPTS : cmdhist:complete_fullquote:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath BASH_VERSINFO : 4 EUID : 1000
Problem solved indeed.
Thanks Rik :°)
|
|