Alias Command in Bourne Shell


 
Thread Tools Search this Thread
Operating Systems AIX Alias Command in Bourne Shell
# 1  
Old 04-01-2011
Question Alias Command in Bourne Shell

Hi

My Unix sever is AIX 5.3. My Login shell ( using echo $SHELL) is /bin/sh implying it is a Bourne Shell. My Question is that i am still able to use Alias command to create/retrieve aliases. I have read in several sites on Unix online that the Bourne Shell does not support Aliases but only Shell functions. So what am i missing here?Is there a way to explain this discrepancy?


Thanks Smilie,

Last edited by pchegoor; 04-01-2011 at 02:13 PM..
# 2  
Old 04-01-2011
/bin/sh for POSIX compliant UNIX systems must support aliases - because the POSIX standards require it.

/bin/sh is a POSIX shell, even if it has Bourne shell roots.
This User Gave Thanks to jim mcnamara For This Post:
# 3  
Old 04-01-2011
Thanks Jim . How does find out that a given shell is POSIX compliant? Thanks.
# 4  
Old 04-01-2011
Humm, on 5.3 /usr/bin/sh is the default shell and is a link to the Korn Shell. Check that /bin/sh is not also a link to the Korn Shell.
# 5  
Old 04-01-2011
Thanks Murphy. How do i check this linking of /bin/sh to Korn Shell. I am new to Unix .Is there a command to do so? Thanks.
# 6  
Old 04-01-2011
Code:
ls -l /bin/sh

you will see something like this at the end of the line: -> /usr/bin/ksh
the "->" tells you the name of the file the link points to.

most file have something that looks like this: -rwxr-xr-x at the begining of the line output by ls -l. Directories look like drwxr-xr-x links: lrwxrwxr-x. The first character tells you if it is a special type of file, not just a regular file.
# 7  
Old 04-01-2011
Thanks Jim. I found out that on my Unix AIX 5.3 the /bin is linked to /usr/bin so i did the following :

ls -l /usr/bin/sh and i got the following.

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

But this still does not show the linking to ksh .So where can i find it?

Thanks,
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