免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1775 | 回复: 8
打印 上一主题 下一主题

set -o vi 失败 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-03-15 21:42 |只看该作者 |倒序浏览
我在solaris10下无法重复上一条命令,甚至不能编辑本条命令,而且当我使用set -o vi时提示 -o选项错误。请问是怎么回事呀?谢谢!

论坛徽章:
0
2 [报告]
发表于 2005-03-15 22:11 |只看该作者

set -o vi 失败

ksh才支持这个选项

论坛徽章:
0
3 [报告]
发表于 2005-03-15 22:48 |只看该作者

set -o vi 失败

请问一梦如是,我怎样才能知道我用的是什么shell,如果不是ksh我该怎么办?谢谢!

论坛徽章:
0
4 [报告]
发表于 2005-03-15 23:06 |只看该作者

set -o vi 失败

ksh -o vi

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
5 [报告]
发表于 2005-03-16 01:40 |只看该作者

set -o vi 失败

install GNU/Linux,uninstall urSolaris

论坛徽章:
0
6 [报告]
发表于 2005-03-16 08:30 |只看该作者

set -o vi 失败

[quote]原帖由 "youngbird"]请问一梦如是,我怎样才能知道我用的是什么shell,如果不是ksh我该怎么办?谢谢![/quote 发表:

echo $0
如果想把登录的shell改为ksh,可以找系统管理员。如果想临时使用ksh,可以直接运行ksh。

论坛徽章:
0
7 [报告]
发表于 2005-03-16 21:25 |只看该作者

set -o vi 失败

[quote]原帖由 "dradhzn"]ksh -o vi[/quote 发表:


首先谢谢楼上几位!
这个方法可以。但是,在使用ksh -o vi 之前,我执行 echo $0,结果为-sh;
而当我执行ksh -o vi 之后,echo $0,结果为-ksh,也就是说我更改了shell才可以对命令行进行编辑。我想知道,在sh下,就不能对命令行进行编辑吗?

论坛徽章:
0
8 [报告]
发表于 2005-03-16 23:45 |只看该作者

set -o vi 失败

got time , read it .

quoted from article "UNIX shell differences and how to change your shell"  ( author : Brian Blackmore, bnb@looking-glass.org ; Newsgroups: comp.unix.shell, comp.unix.questions ; Date: 13 Jul 1997 )


Shell features

   This table below lists most features that I think would make you
   choose one shell over another. It is not intended to be a definitive
   list and does not include every single possible feature for every
   single possible shell. A feature is only considered to be in a shell
   if in the version that comes with the operating system, or if it is
   available as compiled directly from the standard distribution. In
   particular the C shell specified below is that available on SUNOS 4.*,
   a considerable number of vendors now ship either tcsh or their own
   enhanced C shell instead (they don't always make it obvious that they
   are shipping tcsh.

                                     sh   csh  ksh  bash tcsh zsh  rc   es
Job control                          N    Y    Y    Y    Y    Y    N    N
Aliases                              N    Y    Y    Y    Y    Y    N    N
Shell functions                      Y(1) N    Y    Y    N    Y    Y    Y
"Sensible" Input/Output redirection  Y    N    Y    Y    N    Y    Y    Y
Directory stack                      N    Y    Y    Y    Y    Y    F    F
Command history                      N    Y    Y    Y    Y    Y    L    L
Command line editing                 N    N    Y    Y    Y    Y    L    L
Vi Command line editing              N    N    Y    Y    Y(3) Y    L    L
Emacs Command line editing           N    N    Y    Y    Y    Y    L    L
Rebindable Command line editing      N    N    N    Y    Y    Y    L    L
User name look up                    N    Y    Y    Y    Y    Y    L    L
Login/Logout watching                N    N    N    N    Y    Y    F    F
Filename completion                  N    Y(1) Y    Y    Y    Y    L    L
Username completion                  N    Y(2) Y    Y    Y    Y    L    L
Hostname completion                  N    Y(2) Y    Y    Y    Y    L    L
History completion                   N    N    N    Y    Y    Y    L    L
Fully programmable Completion        N    N    N    N    Y    Y    N    N
Mh Mailbox completion                N    N    N    N(4) N(6) N(6) N    N
Co Processes                         N    N    Y    N    N    Y    N    N
Builtin artithmetic evaluation       N    Y    Y    Y    Y    Y    N    N
Can follow symbolic links invisibly  N    N    Y    Y    Y    Y    N    N
Periodic command execution           N    N    N    N    Y    Y    N    N
Custom Prompt (easily)               N    N    Y    Y    Y    Y    Y    Y
Sun Keyboard Hack                    N    N    N    N    N    Y    N    N
Spelling Correction                  N    N    N    N    Y    Y    N    N
Process Substitution                 N    N    N    Y(2) N    Y    Y    Y
Underlying Syntax                    sh   csh  sh   sh   csh  sh   rc   rc
Freely Available                     N    N    N(5) Y    Y    Y    Y    Y
Checks Mailbox                       N    Y    Y    Y    Y    Y    F    F
Tty Sanity Checking                  N    N    N    N    Y    Y    N    N
Can cope with large argument lists   Y    N    Y    Y    Y    Y    Y    Y
Has non-interactive startup file     N    Y    Y(7) Y(7) Y    Y    N    N
Has non-login startup file           N    Y    Y(7) Y    Y    Y    N    N
Can avoid user startup files         N    Y    N    Y    N    Y    Y    Y
Can specify startup file             N    N    Y    Y    N    N    N    N
Low level command redefinition       N    N    N    N    N    N    N    Y
Has anonymous functions              N    N    N    N    N    N    Y    Y
List Variables                       N    Y    Y    N    Y    Y    Y    Y
Full signal trap handling            Y    N    Y    Y    N    Y    Y    Y
File no clobber ability              N    Y    Y    Y    Y    Y    N    F
Local variables                      N    N    Y    Y    N    Y    Y    Y
Lexically scoped variables           N    N    N    N    N    N    N    Y
Exceptions                           N    N    N    N    N    N    N    Y

Key to the table above.

   Y      Feature can be done using this shell.
         
   N      Feature is not present in the shell.
         
   F      Feature can only be done by using the shells function
          mechanism.
         
   L      The readline library must be linked into the shell to enable
          this Feature.
         
Notes to the table above

    1. This feature was not in the orginal version, but has since become
       almost standard.
    2. This feature is fairly new and so is often not found on many
       versions of the shell, it is gradually making its way into
       standard distribution.
    3. The Vi emulation of this shell is thought by many to be
       incomplete.
    4. This feature is not standard but unoffical patches exist to
       perform this.
    5. A version called 'pdksh' is freely available, but does not have
       the full functionality of the AT&T version.
    6. This can be done via the shells programmable completion mechanism.
    7. Only by specifing a file via the ENV environment variable.
      
How to change your shell

   If you ever look at a UNIX manual page it will say that to change your
   shell use chsh or passwd -s; unfortunately it often isn't as simple as
   this, since it requires that your new shell is recognized as a valid
   shell by the system and at present many systems do not recognize the
   newer shells (the normal selection is, /bin/sh, /bin/csh and possibly
   /bin/ksh). You are thus left with having to do some sort of fudge,
   changing your effective login shell without changing your official
   entry in /etc/passwd. You may also be left with the problem that there
   isn't a compiled binary on your system , so you will have to get hold
   of the shell's source and compile it yourself (Its generally best to
   ask around to see if anyones done this already, since it isn't that
   easy). Once done you should add in code to your old shells login file
   so that it overlays your official login shell with your new shell
   (remember to add the login flags to the command line, and with
   csh/tcsh ensure that the overlay doesn't happen recursively since they
   both read the same .login file).
   
   The shell can be recognized as a valid shell if the system
   administrator puts it in the file /etc/shells. If this file does not
   exist, it must be created and should contain all valid shells
   (i.e.don't forget the traditional ones in all their forms).
   
WARNING

    If you do decide to change your shell you must be very careful - if
   handled wrongly it can be almost impossible to correct, and will
   almost certainly cause you a lot of hassle. Never make a new shell a
   login shell until you have tested its new configuration files
   thoroughly and then tested them once again. It is also important that
   you make a full backup of your previous config files onto a floppy
   disk (or a different host if you have a second account) if you have to
   change any of them (which you will probably have to do if you can't
   change your shell entry in /etc/passwd). You should also note that
   your new shell is probably not supported by your system admin, so if
   you have any problems you will probably have to look elsewhere.
[/quote]

论坛徽章:
0
9 [报告]
发表于 2005-03-17 22:04 |只看该作者

set -o vi 失败

明白了,感谢几位,尤其是dradhzn的帮助!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP