WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: complete noob question  (Read 3344 times)

Offline Nate_the_great

  • Newbie
  • *
  • Posts: 7
complete noob question
« 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

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: complete noob question
« Reply #1 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.

Offline saladin

  • Jr. Member
  • **
  • Posts: 61
Re: complete noob question
« Reply #2 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.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: complete noob question
« Reply #3 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".

Offline saladin

  • Jr. Member
  • **
  • Posts: 61
Re: complete noob question
« Reply #4 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.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: complete noob question
« Reply #5 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

tinycorelinux

  • Guest
Re: complete noob question
« Reply #6 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


Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11705
Re: complete noob question
« Reply #7 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

Offline saladin

  • Jr. Member
  • **
  • Posts: 61
Re: complete noob question
« Reply #8 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.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11705
Re: complete noob question
« Reply #9 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?

Offline saladin

  • Jr. Member
  • **
  • Posts: 61
Re: complete noob question
« Reply #10 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.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: complete noob question
« Reply #11 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!

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: complete noob question
« Reply #12 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, 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.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: complete noob question
« Reply #13 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.