Alias Command in Bourne Shell


 
Thread Tools Search this Thread
Operating Systems AIX Alias Command in Bourne Shell
# 8  
Old 04-01-2011
See the link count of 5. Check link count of and size of /usr/bin/ksh. Are they the same?
# 9  
Old 04-01-2011
Hi Murphy.
I executed the following : ls -l /usr/bin/ksh and the result is this :

-r-xr-xr-x 5 bin bin 290006 Jul 18 2010 /usr/bin/ksh

So this matches the result from ls -l /usr/bin/sh.


I also did a diff /usr/bin/sh /usr/bin/ksh and got nothing. So can i safely confirm that the file usr/bin/sh is same as file /usr/bin/ksh? Therefore the default shell in my case is actually a Korn shell even though the command echo $SHELL output /bin/sh?

Thanks,
Prashant
# 10  
Old 04-02-2011
It would appear that it is the Korn shell.

To be certain, what is the output of the following command?
Code:
echo ${.sh.version}


Last edited by fpmurphy; 04-02-2011 at 10:38 AM..
# 11  
Old 04-02-2011
The Output of the command echo ${.sh.version} is :

sh: ${.sh.version}: 0403-011 The specified substitution is not valid for this command.


Thanks.
# 12  
Old 04-04-2011
Quote:
Originally Posted by pchegoor
The Output of the command echo ${.sh.version} is :

sh: ${.sh.version}: 0403-011 The specified substitution is not valid for this command.
This expansion only works in ksh93 and it means that you are using a 1988-version of the Korn shell. You can verify this by switching to vi-style command line editing mode and then pressing "CTRL-V" in command mode:

Code:
# set -o vi
# <ESC>
# <CTRL>-V
# Version M-11/16/88f

This is the output of an AIX 5.2-shell and shows a 88 version, revision "f".

To partially answer your original question: a POSIX-compliant system (which AIX is) is required to have a POSIX-shell in /bin/sh. If this is a link to another shell or an original binary doesn't matter. The user just can rely on the fact that issuing "/bin/sh" on the commandline will invoke a POSIX-compliant shell somehow.

What the requirements for a POSIX compliant shell are is laid down in the POSIX standards papers, issued and developed by the IEEE. What that in detail means i don't (read: never wanted to) know as i took IBMs word for their implementation of the shell being POSIX compliant at face value, but you could easily find that out by reading the paper and cross-checking it with the ksh documentation.

I hope this helps.

bakunin

Last edited by bakunin; 04-04-2011 at 08:09 AM..
# 13  
Old 04-04-2011
Thanks Bakunin. That was a great explanation.My orginal query has now been answered.Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Alias is not working under Bourne Shell

Hi, Please assist me why HC alias is not working under this shell? root@singapore # grep HC /.profile alias HC='cd /var/tmp/HC/2015/`date +%B`' root@singapore # . /.profile Sourcing //.profile-EIS..... root@singapore # echo $HC root@singapore # HC HC: not found root@singapore # echo... (18 Replies)
Discussion started by: tprabhu1983
18 Replies

2. Shell Programming and Scripting

Is there any command in the Bourne shell?

Hi, The problem I have is that I want to create a list of folders whose names are read from a text file but the file names are in decimal. Each letter consists of an octet and the end of the folder name is defined by the white space character (0032) For example, we have in the text... (2 Replies)
Discussion started by: Gengis-Kahn
2 Replies

3. Shell Programming and Scripting

How to activate Korn Shell functionnalities in Bourne Shell

Hi All I have writing a Korn Shell script to execute it on many of our servers. But some servers don't have Korn Shell installed, they use Borne Shell. Some operations like calculation don't work : cat ${file1} | tail -$((${num1}-${num2})) > ${file2} Is it possible to activate Korn Shell... (3 Replies)
Discussion started by: madmat
3 Replies

4. UNIX for Dummies Questions & Answers

Bourne Shell Script that only takes command line arguments

Does anybody know how to Accept a “userid” as a command line argument on a Unix Bourne Shell Script? The output should be something like this: User userid has a home directory of /path/directory the default shell for this user is /path/shell (5 Replies)
Discussion started by: ajaira
5 Replies

5. UNIX for Advanced & Expert Users

Bourne Shell Script that only takes command line arguments

Does anybody know how to Accept a “userid” as a command line argument on a Unix Bourne Shell Script? The output should be something like this: User userid has a home directory of /path/directory the default shell for this user is /path/shell (1 Reply)
Discussion started by: ajaira
1 Replies

6. Shell Programming and Scripting

Bourne Shell Script that only takes command line arguments

Does anybody know how to Accept a “userid” as a command line argument on a Unix Bourne Shell Script? The output should be something like this: User userid has a home directory of /path/directory the default shell for this user is /path/shell (1 Reply)
Discussion started by: ajaira
1 Replies

7. Shell Programming and Scripting

I need to understand the differences between the bash shell and the Bourne shell

I do not claim to be an expert, but I have done things with scripts that whole teams of folks have said can not be done. Of course they should have said we do not have the intestinal fortitude to git-r-done. I have been using UNIX actually HPUX since 1992. Unfortunately my old computer died and... (7 Replies)
Discussion started by: awk_sed_hello
7 Replies

8. Shell Programming and Scripting

Maximum command length in bourne shell

Hi, I wanted to know what is the maximum length of command which can be run on a bourne (sh) shell? Where can I find that information? Is it different for different OS flavors? Please help. Thanks, Vineet (10 Replies)
Discussion started by: vineetd
10 Replies

9. UNIX for Dummies Questions & Answers

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

10. Shell Programming and Scripting

Bourne: How to invoke an alias from within a shell script

Bourne: How to invoke an alias from within a shell script If I type in the alias in the command line, it runs If I insert that same alias into my shell script and run the shell script, the alias is not invoked. Help please. (2 Replies)
Discussion started by: techshots
2 Replies
Login or Register to Ask a Question