Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am fairly new to AIX machine. We would like to deploy some program into the AIX machine which is yet to come.

We have a short experience in AIX machine and after login using putty, we felt the shell is very weird and some aspects compared to the Red Hat Linux we are using. The backspace is not functional, and some arrow key have weird behaviour too.

Anyway, assume this is a healthy machine, I would like to ask, if we create a .sh file and execute it, what is the default shell for it? And what is the default shell after login?

share|improve this question

3 Answers 3

up vote 3 down vote accepted

Red Hat uses bash as its shell; AIX will use a modified commercial-UNIX Bourne Shell or various out-of-date (and buggy) versions of ksh depending on version (as of AIX 4, it was either a buggy ksh88 or a buggy clone thereof). If you want arrow keys, you will need to run ksh or bash (and if the ksh on that version of AIX is still pre-ksh93, arrow keys won't work although Ctrl + P / Ctrl + N will).

Backspace not working is a symptom of the stty settings being incorrect; Linux generally prefers DEL for backspace, but AIX uses the System III/V standard Ctrl + H by default. Try stty sane; tset -Q. (This may still leave it at ^H, in which case you'll need stty erase '^?'.) While you're at it, make sure $TERM is correct (it should usually be xterm or xterm-color; if the latter doesn't work, use the former).

share|improve this answer
    
The wiki said that AIX use Korn-Shell, is the wiki too old? "The default shell was Bourne shell up to AIX version 3, but was changed to Korn shell (ksh88) in version 4 in view of XPG4 and POSIX compliance." en.wikipedia.org/wiki/IBM_AIX –  lamwaiman1988 Jul 15 '11 at 2:51
    
You didn't specify which AIX you were using; and at least as of AIX 4.3.3, sh was not (or not a normal) ksh, and was often buggy; a bsh was provided for scripts that broke under sh. I presume this was because of contractual requirements to maintain bug-level compatibility in sh). You will still need to make sure $TERM and the stty settings are correct, and arrow keys will not work in ksh88. –  geekosaur Jul 15 '11 at 3:03
    
Come to think of it, maybe it was ksh88 — not ksh88i, which is what I have experience with, and was preferred to ksh88 for good reason. –  geekosaur Jul 15 '11 at 3:13
    
We have no idea about the version because the machine is yet to come. Thanks. Can you please edit the asnwer specific to different version of AIXs? –  lamwaiman1988 Jul 15 '11 at 3:22
    
If it's a new machine it'll probably be AIX 6.1; I don't know anything about the shell there. :( –  geekosaur Jul 15 '11 at 4:48

The default shell in any 5.x -> 6.x version of AIX is ksh.

As of version 6100-04-03-1009 of AIX, ksh is installed running Version M-11/16/88f.

To display the version on your machine, change to vi-mode:

# set -o vi

Hit Esc, then hit Ctrl-v.

# Version M-11/16/88f
share|improve this answer
    
Another way to see the version is echo ${.sh.version}. Or is that only in ksh93? –  Gilles Aug 1 '11 at 20:40

If you need to support a variety of environments, and you've already written and tested the scripts for bash, you can consider installing the AIX toolbox for Linux. After that is done, you can add /opt/freeware/bin to everyone's path and use bash.

http://www-03.ibm.com/systems/power/software/aix/linux/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.