Simple question: alias not working for root

OS = Solaris 8
Issue: alias not working for root, but working for regular users

# grep root /etc/passwd
root:x:0:1:Super-User:/:/sbin/sh

# alias dir=ls
# dir
dir: not found

# alias dir="ls -l"
# dir
dir: not found

# alias dir='ls -l'
# dir
dir: not found

# alias
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 $$'

# alias dir=ls
# echo $#
0

Thanks.

Just switch to /usr/xpg4/bin/sh, /bin/ksh or /bin/bash. /sbin/sh doesn't support aliases on Solaris 10 and older.

1 Like

Yes. You are right. It's working now.

Thanks a lot, jlliagre :slight_smile: