Tiny Core Linux

Tiny Core Extensions => TCE Talk => Topic started by: Nate_the_great on August 26, 2020, 04:11:12 PM

Title: complete noob question
Post by: Nate_the_great on August 26, 2020, 04:11:12 PM
how to use getlocale.sh??
i type
Code: [Select]
sudo getlocale.shand i get the return 
Code: [Select]
no such file or directory
how is it not found after I download it?
i had the onboot selection in the apps browser

i am on tiny core 11 32 bit version
Title: Re: complete noob question
Post by: Juanito on August 27, 2020, 01:53:20 AM
The getlocale extension is meant to be run once to create the mylocale extension, so it should not be set "onboot".

You could try removing getlocale from onboot, rebooting and then load it normally.
Title: Re: complete noob question
Post by: saladin on September 11, 2020, 02:45:44 PM
I was also having trouble with this today. By default, you are not setup to run shell scripts. You need to install bash.tcz before shell scripts will run.
Title: Re: complete noob question
Post by: GNUser on September 11, 2020, 02:59:11 PM
saladin, TCL comes with Busybox, which includes the  ash  shell. As such, TCL is certainly setup to run shell scripts (including the getlocale.sh script included in the getlocale extension) by default.

The bash extension is only required for running scripts that contain portability-busting "bashisms".
Title: Re: complete noob question
Post by: saladin on September 11, 2020, 03:05:30 PM
Ok, I guess I just don't know how to run a shell script without bash. I kept getting that same error that the script could not be found, when I specified the entire path to it, or I moved to the containing directory.
Title: Re: complete noob question
Post by: GNUser on September 11, 2020, 03:27:05 PM
What's the very first line in the script that's giving you problems? It should look something like this: #!/foo/bar
Title: Re: complete noob question
Post by: tinycorelinux on September 11, 2020, 08:18:57 PM
Code: [Select]
tce-load -wi getlocale.tcz
tce-load -wi glibc_add_lib.tcz
sudo getlocale.sh

Title: Re: complete noob question
Post by: Rich on September 11, 2020, 09:27:28 PM
Hi NONE
Code: [Select]
tce-load -wi getlocale.tcz
 ----- Snip -----
That will add  getlocale.tcz  to the  onboot.lst  file.

Juanito said:
The getlocale extension is meant to be run once to create the mylocale extension, so it should not be set "onboot". ...

If you add an  l  to the options it won't be added to  onboot.lst  file:
Code: [Select]
tce-load -wil getlocale.tcz
Title: Re: complete noob question
Post by: saladin on September 11, 2020, 10:30:30 PM
What's the very first line in the script that's giving you problems? It should look something like this: #!/foo/bar

Yup. I'm an idiot. #!bin/bash. If I change bash to ash, it will work? It's all commands that work without bash. No fancy loops or anything.
Title: Re: complete noob question
Post by: Rich on September 11, 2020, 11:14:58 PM
Hi saladin
It should be:
Code: [Select]
#!/bin/shThe  /bin/sh  link points to  busybox ash.

Yup. I'm an idiot. #!bin/bash. ...
That's a typo, right? You actually had  #!/bin/bash , right?
Title: Re: complete noob question
Post by: saladin on September 12, 2020, 08:43:24 AM
Yes, that was a typo. I did have the script running once I installed bash.  :P

Thanks for the tip. I'll fix my script and not install bash in the future.
Title: Re: complete noob question
Post by: GNUser on September 12, 2020, 09:25:53 AM
Hi, saladin. I'm glad you sorted it out. If you avoid bashisms in your scripts, #!/bin/sh should work on pretty much any Unix-like OS (e.g., any linux or BSD version).

Happy hacking!
Title: Re: complete noob question
Post by: andyj on September 12, 2020, 10:45:26 AM
So, besides arrays (which you can kludge around like I did here http://forum.tinycorelinux.net/index.php/topic,21017.msg131770.html#msg131770 (http://forum.tinycorelinux.net/index.php/topic,21017.msg131770.html#msg131770), which are the most common bashisms that are causing problems with /busybox/ash? More to the point, which don't have simple fixes like syntax? Even ash has some extensions to POSIX.
Title: Re: complete noob question
Post by: GNUser on September 12, 2020, 12:22:28 PM
Hi, andyj. Greg's wiki has the most helpful discussion of bashisms I've seen:
https://mywiki.wooledge.org/Bashism
P.S. For most intents and purposes, dash and Busybox ash are identical.