LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 593|回复: 2

请问这些shell语句有错吗?

[复制链接]
发表于 2004-10-22 21:17:51 | 显示全部楼层 |阅读模式
因为工作需要要在 linux 和 unix 之间切换,就要有相应的设定。于是写了下面
的脚本。在linux下正常,但是在 unix 下就会说找不到 whoami ,可能是
source 那句没起作用。请问我写得有问题吗?

#!/bin/csh
#
set HOSTOS = `uname`
if ( $HOSTOS == "SunOS" ) then
        if ( -f /home/tools/cshrc.systerm ) then
        source /home/tools/cshrc.system
    else if ( -f /etc/cshrc.system ) then
        source /etc/cshrc.system
    endif
endif

#--- PERSONAL ALIASES ---
if ( $?prompt ) then
        set history=50
        set savehist=50
endif

alias cd            'cd \!*;set prompt="`hostname`{`whoami`}:`pwd`> "'
set prompt="`hostname`{`whoami`}\!: "
发表于 2004-10-23 02:21:20 | 显示全部楼层
你确认在你的unix系统上有whoami这个命令吗?
发表于 2004-10-23 02:23:20 | 显示全部楼层
你确认在你的unix系统上有whoami这个命令吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表