切换用户只执行一条命令的可以用: su - oracle -c command切换用户执行一个shell文件可以用:su - oracle -s /bin/bash shell.sh
获取用户名或者ID
echo “$UID” echo “$USER” id whoami