- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Why I need to run sh to use vi
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
Discussions
Discussions
Forums
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
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
тАО02-12-2009 01:19 PM
тАО02-12-2009 01:19 PM
Why I need to run sh to use vi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-12-2009 02:57 PM
тАО02-12-2009 02:57 PM
Re: Why I need to run sh to use vi
Our default environment apparently lacks variables needed to run vi.
After you run sh you get a new environment that lets vi work.
/etc/profile or .profile are missing the source of variables needed for vi.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2009 01:21 AM
тАО02-13-2009 01:21 AM
Re: Why I need to run sh to use vi
you can check your shells with 'which vi' to see if the shell recognizes the command.
Also you can add:
EDITOR=vi
export EDITOR
in your .profile.
HTH
Volkmar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2009 05:35 AM
тАО02-13-2009 05:35 AM
Re: Why I need to run sh to use vi
if not set try to force the value in the .profile (look at the tset commands in this file)
try this too
# reset
and/or
# resize
before starting vi
(note that starting ksh will not reload the profile files nor the .kshrc, it is done with a login shell)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2009 06:13 AM
тАО02-13-2009 06:13 AM
Re: Why I need to run sh to use vi
ksh and sh should be compatible with vi.
bash is not by default.
To Open an appropriate shell and ensure
export EDITOR=vi
set -o vi
is only make things more comfortable,
but
principaly it should work from the first
shell.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2009 06:34 AM
тАО02-13-2009 06:34 AM
Re: Why I need to run sh to use vi
I think your ksh-shell doesn't 'know' the path of vi.
'which vi' -> /usr/bin/vi
Check if /usr/bin is in your /etc/PATH.
You could also check with 'env|grep PATH' if the path is known in ksh or sh.
Look for differences between both shells.
You can expand /etc/PATH with /usr/bin.
After a new login it should work.
V.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2009 12:28 PM
тАО02-13-2009 12:28 PM
Re: Why I need to run sh to use vi
It finds a vi since Anh-Thu said it was hanging.
>'which vi' -> /usr/bin/vi
The proper real shell command is "whence vi". It just may not be /usr/bin/vi.