Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

I am unable to run vi in Single User mode

Posted on 2006-10-24
9
Medium Priority
?
400 Views
Last Modified: 2013-12-13
Hello,

    Can some please help me with this i am unable to run VI in the Single user mode ...I exported the term and it  still did not work ..

set TERM=vt100
export TERM

set vi -o

I am unable to edit the file ...

Thanks all for your help in advance .
0
Comment
Question by:kaka123
  • 4
  • 3
  • 2
9 Comments
 
LVL 43

Expert Comment

by:ravenpl
ID: 17796154
> set vi -o
what's that?

try: /bin/vi filename # OR: /usr/bin/vi filename
0
 
LVL 34

Expert Comment

by:PsiCop
ID: 17797415
The "set vi -o" is a bash shell command that tells it to use vi-style command-line editing. Yuck.

Personally, I prefer Emacs style.

vi is dependent on libraries in /usr/lib. If you've booted into single-user mode and not all filesystems have been mounted, vi may not be able to run. Assuming you have used multiple disk slices for your filesystems, try "mountall" and then re-try vi.

Alternatively, ex was written to be self-sufficient and able to run in single-user mode.
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17797514
Strange - but my /bin/vi does not depend on /usr/lib
In fact none from /sbin /bin should depend on anything from /usr ...

> The "set vi -o" is a bash shell command that tells it to use vi-style command-line editing.
Thanx - always learning ;)
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

Author Comment

by:kaka123
ID: 17798266
As i mention in the question above that i am in S mode and i have try this

set TERM=vt100
export TERM

set vi -o
   
 what am i doing wrong this a sles 9 machin ...HELP ....
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17798410
And then You are running
vi /etc/fstab # for example? What's the error message?
0
 
LVL 34

Expert Comment

by:PsiCop
ID: 17799035
I'll qualify my comment about vi needing libraries as being true in SunOS and Solaris. Altho with all the changes in Solaris 9 and Solaris 10, it might have changed.

"vi" in Linux is sometimes "vim" and so my comment would not apply (just like "mail" in SLES is actually "nail").

Back to the Question...I agree, we need the EXACT error message. What is displayed when you try to run vi?
0
 

Author Comment

by:kaka123
ID: 17799446
nothing i just can't edit the file when i type the above command let's say set vi -o it will go back to the command prompt with no errors but when i try to do vi it will not work strange .........HELP THE BOX IS STILL IN S MODE ...
0
 
LVL 43

Assisted Solution

by:ravenpl
ravenpl earned 400 total points
ID: 17801232
So You are saying that You typing
vi /etc/fstab
and it does nothing, just returnig to the shell prompt?
If so, then honestly I don't know what happens.
But, have You tried /bin/vi /usr/bin/vi
Maybe another editor like: nano OR joe OR pico OR jed

OT: if the OS in S mode, You may need to remount the rootfs in RW mode: mount -o rw,remount /
but even that vi should still run(inRO mode)
0
 
LVL 34

Accepted Solution

by:
PsiCop earned 1600 total points
ID: 17804722
"set vi -o" is a SHELL CONFIGURATION command. It is applicable only to bash, as I recall. ksh or zsh might also support it, I dunno. Point is that it has NOTHING to do with *running* vi. All it does is tell the shell what command-line editing scheme you want to use. And it doesn't have any effect in sh, as I recall. You could very well be in an sh shell in single-user mode.

Bottom line: "set vi -o" is not relevant to your issue of not being able to run vi.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month12 days, 7 hours left to enroll

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question