[Solved] Aliases in HP-UX

Hi folks,

How can I make an alias in HP-UX? I've tried to add something just like this

bye='exit'

(as example), the system accepted but when I write bye in the terminal its return with invalid command. When I make such alias in RedHat or Fedora the system accept it right there, what is the right method in adding the Aliases in HP-UX?

Or, where can I find the alias file so can I modify it and add whatever I want of aliases.

Thanks in advance...

Leo

This mostly isn't OS specific but shell specific. it would be alias bye=exit and placed in .kshrc or .shrc most likely.

You need preceded the assignment with the command alias

alias bye='exit'

If you are using the default Shell in HP-UX or ksh, place the command in your .profile file .

I'm using sh shell, but I can't find the .profile file in the home directory, even when I (ls) the hidden files via ls -A.

Then you would need to create .profile in your home directory.

The weird thing is that I have many aliases in my system when I run

alias

command the system list many of per-defined aliases that created by the vendor of the system!

Aliases can also be set in /etc/profile for all users and also, Posix shell has a number of default aliases which can be unset..

From man sh-posix :

      The following exported aliases are compiled into the shell but can be
      unset or redefined:

           autoload='typeset -fu'
           command='command '
           functions='typeset -f'
           history='fc -l'
           integer='typeset -i'
           local=typeset
           nohup='nohup '
           r='fc -e -'
           stop='kill -STOP'
           suspend='kill -STOP $$'
           type='whence -v'

That should be ls -a (not ls -A ).

To just list the "hidden" files:

ls -ald .??*