2016-08-12 58 views
0

我正在使用AIX機器。我有一個擔心。我使用MobaXterm來訪問AIX服務器。我預計向上箭頭鍵給我以前發佈的命令。相反,它只是在一些編輯器中上升。使用向下箭頭鍵可以看到相同的行爲。我怎樣才能擺脫這種行爲?AIX - 默認shell - 箭頭鍵

shell是ksh。

謝謝。

+1

你可以使用'bash',而不是'ksh' –

+0

它的工作原理。但是當我回顯$ SHELL時,它會給出ksh。這是對的嗎? – Marco99

+0

使用這樣的腳本:'export SHELL = $(which bash); exec bash' –

回答

0

當終端發送正常模式光標鍵時,您會看到這種行爲。 ksh可能正在尋找應用程序模式密鑰,或者(更可能)沒有被告知如何處理這個。你可以把它用

set -o emacs 

工作,但可能還需要建立鍵綁定(在第一個鏈接中找到):

# 
# The ksh has an undocumented way of binding the arrow keys to the emacs 
# line editing commands. In your .kshrc or in your .profile, add: 

alias __A=`echo "\020"` # up arrow = ^p = back a command 
alias __B=`echo "\016"` # down arrow = ^n = down a command 
alias __C=`echo "\006"` # right arrow = ^f = forward a character 
alias __D=`echo "\002"` # left arrow = ^b = back a character 
alias __H=`echo "\001"` # home = ^a = start of line 

# Type "set -o emacs" or put this line in your .profile. 
set -o emacs 

在一個快速檢查,這個工作對我來說,與正常模式鍵。

延伸閱讀:

0
  1. $SHELL是檢查您正在運行的外殼的正確變量。在shell腳本中使用$1以檢索傳遞給該腳本的第一個參數。我不知道爲什麼印刷sh說實話。
+0

我在意識到自己的錯誤後編輯了這個問題。 – Marco99