LWN.net Logo

add sh/bash to pain list

add sh/bash to pain list

Posted Feb 22, 2007 0:16 UTC (Thu) by tetromino (subscriber, #33846)
In reply to: add sh/bash to pain list by b7j0c
Parent article: The Road to KDE 4: CMake, a New Build System for KDE (KDE.News)

> shell based on a modern scripting language
On my machine, a newly-started bash process uses <500K of unshared memory. A newly started python process uses over 1.6M of unshared memory. So if you are like me, having a couple dozen terminal windows open at once, using a python-based shell would mean quite a bit of memory wasted. Now consider that every rc script is a shell script, and that the launchers for a significant percentage of programs are in fact shell scripts, and you can see why python shells aren't exactly popular. In fact, some people are considering switching to minimalistic shells like ash (~100K) and busybox (even less) for non-interactive use.

As for interactive use, I generally don't find myself using a lot of advanced shell features. For-loops are about the most advanced shell syntax I use in interactive mode. For anything more complex, I find that it's generally a better idea to write a brief perl script and save it for later use - for one thing, you don't need to retype a twenty-line function when you need it a month later.


(Log in to post comments)

add sh/bash to pain list

Posted Feb 22, 2007 3:36 UTC (Thu) by b7j0c (subscriber, #27559) [Link]

> A newly started python process uses over 1.6M of unshared memory. So if you
> are like me, having a couple dozen terminal windows open at once, using a
> python-based shell would mean quite a bit of memory wasted

but is it wasted? when i hear "wasted" or "bloat", i ascribe it to resources consumed that do not provide a benefit. a python or perl enabled shell does indeed provide real benefits to users. at least in the case of perl (using a shell like zoidberg), you now have the entirety of CPAN available for interactive use, well integrated with shell variables you set. this isn't a waste.

and even if you have twenty shells open, thats under 40MB. i can't speak for you but i have 2gb on my desktop, why not use it?

add sh/bash to pain list

Posted Feb 22, 2007 5:26 UTC (Thu) by dlang (✭ supporter ✭, #313) [Link]

it's only useful if you are going to use those features. if you aren't going to need them it doesn't matter how neat they are, they are still wasting ram.

while I have 2G on my laptop, and 4G on my server at home, I would prefer to use it for more useful things (including caching directory entries) rather then holding stuff that I just won't use.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds