- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Editor and shell
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2006 08:26 PM
01-01-2006 08:26 PM
Editor and shell
I have some queries regarding Unix OS.
1) what editor do one use?
2) what shell do one use?
3) what is the best shell for root and why?
Regards
Mridul
3)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2006 08:33 PM
01-01-2006 08:33 PM
Re: Editor and shell
Q 1) what editor do one use?
My vote is for "vi" though some people prefer to use "emacs". "vi" is simple and easy to use than "emacs" (** Its my opinion**)
Q 2) What shell do one use ?
Borne shell by default (sh) or Korne shell (ksh)
Q 3) what is the best shell for root and why?
Borne shell is the best shell for root since you can use it in single user mode. It is compiled & linked statically.
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2006 08:37 PM
01-01-2006 08:37 PM
Re: Editor and shell
1)
We can change the editor with EDITOR environment variable.
echo $EDITOR shows your editor type.
EDITOR If the value of this variable ends in emacs,
gmacs, or vi and the VISUAL variable is not set,
the corresponding option is turned on.
2)
By default, It is /bin/sh or /bin/ksh for hp-ux.
You can view the shell type as,
echo $SHELL
3) Best shell is different usage purpose. Advanced one is BASH and KSH is ok.
To change EDITOR and SHELL type you have to change /etc/profile or $HOME/.profile for permanent action.
-Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2006 08:50 PM
01-01-2006 08:50 PM
Re: Editor and shell
BASH is the most advanced Shell as well as TCSH.
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2006 09:00 PM
01-01-2006 09:00 PM
Re: Editor and shell
1) vi is the best and most powerful editor for unix. The best thing about it is same functionality across all platforms.
2) The default shell is different for various flavours of unix. For HPUx it is Posix, for Linux it is bash and so on.
3) In my opinion the default OS shell should be used for root unless otherwise required as it provides you all functionalities required by root and if specific application requires other shell these should be run through particular applications. One major reason for this will be that when you are in sinngle user mode for system maintenance and only root is mounted, the access to other shells will probably not be available.
HTH,
Devender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2006 10:01 PM
01-01-2006 10:01 PM
Re: Editor and shell
http://64.233.161.104/search?q=cache:IbSsx-c9Z6EJ:docs.rinet.ru:8080/UNIXs/ch13.htm+unix+shell+comparison&hl=en&client=firefox-a
(Original site is down, so this is from Google's cache)
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2006 01:02 AM
01-02-2006 01:02 AM
Re: Editor and shell
1. I use 'vi' for its general applicability to any UNIX environment. You can always find it available.
2. The POSIX shell is the default HP-UX shell. It is considered a superset of the 'ksh' shell.
3. NEVER, NEVER, EVER, use anything but '/sbin/sh' for the root account as defined in '/etc/passwd'. The standard shell for HP-UX users is '/usr/bin/sh', whereas the REQUIRED shell for root is /sbin/sh'.
THe difference is that '/usr/bin/sh' has been compiled with dynamically linked libraries whereas '/sbin/sh' uses only static ones.
NEVER change root's shell. The '/usr' filesystem isn't mounted during the early stages of system startup and any shell that needs needs the dynamically libraries therein would not be able to link to them. If you did this for the root user, you would find that your system was unbootable.
Use the '/usr/bin/sh' for all other non-root users. Using the dynamically linked, shared libraries provides a better memory footprint than having the static structure of '/sbin/sh'.
Both '/sbin/sh' and '/usr/bin/sh' are POSIX shells. The old Bourne shell lives as '/usr/old/bin/sh'. You also have '/usr/bin/ksh' which is Korn88 and '/usr/dt/bin/dtksh' which is Korn93. A '/usr/bin/csh' shell is also available.
A very good site for shell scripts and tips is:
http://www.shelldorado.com/
A guide to shells can be found here:
http://docs.hp.com/en/B2355-90046/index.html
As far as the 'csh' shell is concerned, I'd avoid it. The 'csh' shell is far inferior to the Posix ('usr/bin/sh'), 'ksh', and 'bash' shells.
See here, for one discussion of why *not* to use 'csh':
http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/
All shell scripts start with a declaration of the shell interpreter, clearly identifing the shell in use, like this:
#!/usr/bin/sh
#!/usr/bin/ksh
#!/usr/dt/bin/dtksh
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2006 01:26 AM
01-02-2006 01:26 AM
Re: Editor and shell
In short here is the answer,
1) what editor do one use?
A: vi
2) what shell do one use?
A: korn shell , or bourne shell
/usr/bin/ksh or /usr/bin/sh
3) what is the best shell for root and why?
hp-ux POSIX sheel provides many advantage and it can be used widely . /usr/bin/sh
hp-ux supports the following shells:
------------------------------------
The HP-UX operating system supports the following shells:
sh POSIX-conforming command programming language and
command interpreter residing in file /usr/bin/sh. Can
execute commands read from a terminal or a file. This
shell conforms to current POSIX standards in effect at
the time the HP-UX system release was introduced, and
is similar to the Korn shell in many respects. Similar
in many respects to the Korn shell, the POSIX shell
contains a history mechanism, supports job control, and
provides various other useful features.
sh Bourne-shell command programming language and commands
interpreter residing in file /usr/old/bin/sh. Can
execute commands read from a terminal or a file. This
shell lacks many features contained in the POSIX and
Korn shells. The Bourne shell will be obsoleted.
Users are strongly encouraged to switch to the POSIX
shell. The Bourne shell will still be available as
/usr/old/bin/sh, for those users have to use it.
ksh Korn-shell command programming language and commands
interpreter residing in file /usr/bin/ksh. Can execute
commands read from a terminal or a file. This shell,
like the POSIX shell, contains a history mechanism,
supports job control, and provides various other useful
features.
csh A command language interpreter that incorporates a
command history buffer, C-language-like syntax, and job
control facilities.
rsh Restricted version of the POSIX or Bourne shell command
interpreter. Sets up a login name and execution
environment whose capabilities are more controlled
(restricted) than normal user shells.
rksh restricted version of the Korn-shell command
interpreter Sets up a login name and execution
environment whose capabilities are more controlled
(restricted) than normal user shells.
keysh An extension of the standard Korn Shell that uses
hierarchical softkey menus and context-sensitive help.
-----------------------------------------
Further # man sh
cheers,
Raj.