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

x
  • 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.
0
RalphBHarrell
Asked:
RalphBHarrell
  • 2
2 Solutions
 
yokelCommented:
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

EDITOR="vi"
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.
0
 
yuzhCommented:
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



0
 
ahoffmannCommented:
> 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
but
  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.
0
 
yuzhCommented:
We already gave the answer!
0

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