WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: complete noob question  (Read 2624 times)

Offline Nate_the_great

  • Newbie
  • *
  • Posts: 7
complete noob question
« on: August 26, 2020, 01: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

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: complete noob question
« Reply #1 on: August 26, 2020, 10:53:20 PM »
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, 11:45:44 AM »
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

  • Hero Member
  • *****
  • Posts: 1343
Re: complete noob question
« Reply #3 on: September 11, 2020, 11:59:11 AM »
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, 12: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

  • Hero Member
  • *****
  • Posts: 1343
Re: complete noob question
« Reply #5 on: September 11, 2020, 12: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, 05: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: 11178
Re: complete noob question
« Reply #7 on: September 11, 2020, 06: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, 07: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: 11178
Re: complete noob question
« Reply #9 on: September 11, 2020, 08: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, 05: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

  • Hero Member
  • *****
  • Posts: 1343
Re: complete noob question
« Reply #11 on: September 12, 2020, 06: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: 1020
Re: complete noob question
« Reply #12 on: September 12, 2020, 07: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

  • Hero Member
  • *****
  • Posts: 1343
Re: complete noob question
« Reply #13 on: September 12, 2020, 09:22:28 AM »
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.