1833784 Members
2281 Online
110063 Solutions
New Discussion

Bourne vs Korn

 
SOLVED
Go to solution
Spike Burkhardt
Frequent Advisor

Bourne vs Korn

I have a quick question about shells. In ksh, there is a command 'alias'. Is there anything in Bourne that provides this functionality? More specifically, I want to create an alias called 'reboot' that will reboot the computer via /sbin/shutdown -r.

TIA
Hey, I've got three teenage boys!
5 REPLIES 5
Shannon Petry
Honored Contributor

Re: Bourne vs Korn

No, not in true Borne Shell there is not.

Regards,
Shannon
Microsoft. When do you want a virus today?
Pete Randall
Outstanding Contributor

Re: Bourne vs Korn

Careful - there's already a reboot command. You'll be creating confusion with an alias.

Pete

Pete
Jeff Schussele
Honored Contributor

Re: Bourne vs Korn

Hi Spike,

If your shell is /usr/bin/sh then you're actually running the POSIX shell & it DOES have that functionality.
If you're running /usr/old/bin/sh then you're running the Bourne shell and I don't believe it has that ability.
You *should* be running POSIX as it has many enhancements above & beyond Bourne.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
James R. Ferguson
Acclaimed Contributor
Solution

Re: Bourne vs Korn

Hi:

The Bourne shell is obsolete and lacks many of the functions found in more modern shells.

In HP-UX the Bourne shell is actually found in '/usr/old/bin/sh'.

Whatever you do, *never* change root's shell from the Posix shell ('/sbin/sh'). To do so will mean that you will have an unbootable system.

The Posix shell as '/usr/bin/sh' or /sbin/sh' offers a superset of Korn functionality. The former ('/usr/bin/sh') uses dynamically linked libraries to share and conserve resources but requires the '/usr/ filesystem to be mounted to link to those libraries. That's why you have the statically linked executable in '/sbin/sh' to use when '/usr' isn't mounted, as at bootup!

Too, don't create an alias called "reboot". You want to be able to use 'reboot' *and* 'shutdown'. In reality 'shutdown' calls 'reboot' as one of its last task's.

You *can* create a user called "reboot" and make its default shell a wrapper to 'shutdown'. I think this is what your really want to do.

Regards!

...JRF...
Spike Burkhardt
Frequent Advisor

Re: Bourne vs Korn

Wow, what a group. Thanks for all the info. I got more than I asked for but got what I wanted. Classic case of not asking the right question.

spike
Hey, I've got three teenage boys!