Wow,
As you say, just looking at the Anon column there is 4Kb difference.
Something to drive the page scanner wild :)
I would agree that ksh is a nice shell if it is actually if it is the 93
vintage. The older version though is just a little bit inefficient.
Doug
[EMAIL PROTECTED]> time /usr/bin/ksh /tmp/xx.sh
real 1m7.152s
user 1m7.045s
sys 0m0.051s
[EMAIL PROTECTED]> time /usr/bin/bash /tmp/xx.sh
real 0m23.710s
user 0m18.138s
sys 0m5.539s
[EMAIL PROTECTED]> time /usr/bin/ksh93 /tmp/xx.sh
real 0m2.521s
user 0m2.356s
sys 0m0.010s
[EMAIL PROTECTED]> more /tmp/xx.sh
i=0
j=0
while [ $i -lt 50 ];
do
a="Hello World"
while [ $j -lt 100 ];
do
b="$b $a"
if [ "$b" != "do stuff all" ]; then
c="$b"
fi
j=$(( j = j + 1 ))
done
j=0
i=$(( i = i + 1 ))
done
Steven Sim wrote:
Doug;
Listen, I do not wish to start a religious debate. As I mentioned
earlier, to each his or her own. There's nothing wrong with BASH. I
just don't like it just like I don't like cranberries.
But I've nothing against people who like cranberries!
As for BASH memory footprint, here's the pmap BASH vs pmap KSH (my
shell of choice) on a Solaris 10 x86 Update 3 running on my Fujitsu
notebook..
bash-3.00# pmap -x $$
991: bash
Address Kbytes RSS Anon Locked Mode Mapped File
08045000 12 12 4 - rw--- [ stack ]
08050000 528 460 - - r-x-- bash
080E3000 76 40 - - rwx-- bash
080F6000 92 92 - - rwx-- [ heap ]
D25B6000 4 4 - - rwxs- [ anon ]
D25C0000 4 4 - - rwx-- [ anon ]
D25D0000 740 684 - - r-x-- libc.so.1
D2699000 24 24 - - rw--- libc.so.1
D269F000 8 8 - - rw--- libc.so.1
D26B0000 24 12 4 - rwx-- [ anon ]
D26C0000 512 376 - - r-x-- libnsl.so.1
D2740000 20 20 - - rw--- libnsl.so.1
D2745000 32 16 - - rw--- libnsl.so.1
D2750000 44 44 - - r-x-- libsocket.so.1
D276B000 4 4 - - rw--- libsocket.so.1
D2770000 4 4 4 - rwx-- [ anon ]
D2780000 136 92 - - r-x-- libcurses.so.1
D27B2000 28 24 - - rw--- libcurses.so.1
D27B9000 8 8 - - rw--- libcurses.so.1
D27C0000 4 4 - - r-x-- libdl.so.1
D27CA000 132 132 - - r-x-- ld.so.1
D27FB000 4 4 4 - rwx-- ld.so.1
D27FC000 8 8 4 - rwx-- ld.so.1
-------- ------- ------- ------- -------
total Kb 2448 2076 20 -
# pmap -x $$
988: ksh -o vi
Address Kbytes RSS Anon Locked Mode Mapped File
08045000 12 12 4 - rw--- [ stack ]
08050000 164 164 - - r-x-- ksh
08089000 4 4 - - rw--- ksh
0808A000 32 32 - - rw--- [ heap ]
D26C7000 4 4 - - rwxs- [ anon ]
D26D0000 4 4 - - rwx-- [ anon ]
D26E0000 740 684 - - r-x-- libc.so.1
D27A9000 24 24 - - rw--- libc.so.1
D27AF000 8 8 - - rw--- libc.so.1
D27C0000 24 12 4 - rwx-- [ anon ]
D27CA000 132 132 - - r-x-- ld.so.1
D27FB000 4 4 4 - rwx-- ld.so.1
D27FC000 8 8 4 - rwx-- ld.so.1
-------- ------- ------- ------- -------
total Kb 1160 1092 16 -
Granted there's shared libraries and stuff, but looking at the anon
column....
Warmest Regards
Steven Sim
Doug Scott wrote:
Steven Sim wrote:
BASH also occupies more memory. But to each his or her own. I have
nothing against people using BASH. I just don't recommend it as a
root shell.
Steve where do you get your figure here? I am curious in your
benchmarks. Why does bash use more memory than sh?
Doug
_______________________________________________
opensolaris-discuss mailing list
[email protected]
Fujitsu Asia Pte. Ltd.
_____________________________________________________
This e-mail is confidential and may also be privileged. If you are not
the intended recipient, please notify us immediately. You should not
copy or use it for any purpose, nor disclose its contents to any other
person.
Opinions, conclusions and other information in this message that do
not relate to the official business of my firm shall be understood as
neither given nor endorsed by it.
_______________________________________________
opensolaris-discuss mailing list
[email protected]