Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 481
  • Last Modified:

.Profiles for Bourne Shell; How do you setup for History of Commands and recall of previous commands

Need some examples of some initial profiles for new users
that use the Bourne Shell on Sun Solaris.  Need some command
line commands that allow to see the history of commands and recall
previous commands, and editing commands such as vi -o that do not
appear to work.  Thanks for your assistance in advance.
  • 2
2 Solutions
I assume you are trying to do "set -o vi" to set up vi to browse your command line history.
Another way of doing this is in the bourne shell is

export EDITOR

which you can put into your .profile
Also make sure your .sh_history file exists in each users home directory and is writable by the user.
the Bourne Shell doesn't support "set -o vi" command line editing. consider use ksh or bash instead.

If you want to use ksh/bash, put the following in .profile:

# set -o emacs    # use emacs as command line editor
set -o vi         # use vi

> the Bourne Shell doesn't support "set -o vi" command line editing.
it does! (yuzh, seems that this was a typo;-)

the traditinonal way for "command line editing" in bash is not
  set -o vi
  set -o posix
which enables the cursor keys.

Keep in mind to ifdef the   set -o whatever   in your .profile, 'cause other shells read this file too but do not understand it.
We already gave the answer!

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now