WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: BusyBox, bash and sh  (Read 29768 times)

Offline bill41

  • Newbie
  • *
  • Posts: 13
BusyBox, bash and sh
« on: December 01, 2010, 09:56:14 AM »
I very much like the concept of Tiny Core Linux. Minimalism rules OK!
I'm trying to learn enough to make a go of using TCB on my Sony Vaio PCG FX-109K (Pentium III, 256 RAM.  I need to learn a lot more about Linux as my experience to date is installing Ubuntu as dual boot with XP on my desktop machine, and Puppy Linux on the laptop.
I have started reading some of the huge volume of stuff on the web, but I am rather confused by some of what I find.  I would be very grateful if someone could explain, in a few lines, the relationships between BusyBox, bash and sh.  Many thanks. Bill

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: BusyBox, bash and sh
« Reply #1 on: December 01, 2010, 10:56:08 AM »
You can find out all about busybox at http://busybox.net .

Offline gutmensch

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 605
  • I can make it disappear, have no fear!
    • remembrance blog
Re: BusyBox, bash and sh
« Reply #2 on: December 01, 2010, 11:11:40 AM »
Hey Bill,

welcome to the Tinycore forum ;-)

Maybe ^hats^ will move this thread to another section because you're asking more about "general" programs than about the tinycore base, but I'm trying to give you an answer from my very limited knowledge:

Busybox is a project, which tries to "rebuild" almost every needed command on a linux/unix system, so that you do not need to compile source for example from find-utils, coreutils, util-linux-ng and tons of other source packages. In fact busybox reduces the size of needed commands and functions a lot by condensing them to their base functionality. If you ever looked up the "find" man page - it is overwhelming, but usually most of the stuff you don't need every time. The point in busybox is: Compile one busybox executable (with applets you want for your system, e.g. you don't need crond? Ok skip it, it's extendable and completely modifiable!) and /bin/busybox will serve all your commands like ls, rm, cp, mv, etc. without being so big and ultrafunctional like the real ones.

And of course: you also need a shell on a linux/unix - without you can't do very much ;-). Guess what? Busybox also implements a shell! In busybox it's the ash shell, that's why there's .ashrc in your home directory. From my understanding ash is more "mighty" than the bourne shell (sh) but not as complex as the bourne again shell (bash), so it's called ash. E.g. you have limitations on computing numbers or using arrays (if I'm not mistaken) compared to bash.

All the points I mentioned turn busybox into a must-have for nearly all small embedded systems like routers/dsl modems etc. but also for small distros like tinycore or rescue systems :)
If I seem unduly clear to you, you must have misunderstood what I said. (Alan Greenspan)

Offline bill41

  • Newbie
  • *
  • Posts: 13
Re: BusyBox, bash and sh
« Reply #3 on: December 01, 2010, 02:11:40 PM »
Many thanks, gutmensch. Your explanation was very helpful.  I had a look at the busybox website.  That's what prompted my question.  I've got another question, but I'll put it in a new thread.
Bill

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: BusyBox, bash and sh
« Reply #4 on: December 01, 2010, 03:32:18 PM »
As I never found a good man page for the BusyBox 'ash' on the project web page I've started to use this one instead. I don't recall to have run into any real problem, i.e. differences in the behavoiur of BusyBox 'ash' vs. this (external) man page.

OTOH there is always the BusyBox source code that could be read. I found on occasion that it's not too tricky to understand, as most applets are rather compact (mind you a shell might be different in that regard).

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: BusyBox, bash and sh
« Reply #5 on: December 02, 2010, 02:29:09 AM »
/bin/sh is on most systems a symlink to a bourne shell compatible system default shell, of which several may coexist on a system.
bash as a plethora of other shells is compatible with sh-scripts, but bash-scripts are only compatible with bash.
For certain extensions bash is a mandatory dependency, without any need of using it as default shell (which would enhance resource usage and decrease speed).
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)