今天执行脚本aix_xunjian.sh的时候遇到问题
[dacp1][/export/home]#ls -l
total 72
-rwxr-xr-x 1 root sys 2372 Feb 22 09:17 aix_xunjian.sh
drwxr-sr-x 5 dacp cin 1024 Jan 17 16:57 dacp
drwxr-sr-x 2 dacpdb cin 512 Dec 20 2007 dacpdb
drwxr-sr-x 8 dacpoam cin 512 Feb 22 09:00 dacpoam
drwxrwx--x 2 root system 512 Nov 20 2007 lost+found
drwxr-sr-x 2 pdscp staff 512 Dec 11 15:22 pdscp
-rwxr-xr-x 1 dacp cin 195 Dec 19 2007 smit.log
drwxr-sr-x 3 tabmnt1 informix 512 Nov 04 14:46 tabmnt1
drwxr-sr-x 3 tabmnt2 informix 512 Jul 28 2010 tabmnt2
[dacp1][/export/home]#oslevel -r
5300-08
[dacp1][/export/home]#./aix_xunjian.sh
ksh: ./aix_xunjian.sh: not found.
网上查了资料,说是环境变量的原因。
dacp1][/]#env
_=/usr/bin/env
LANG=en_US
LOGIN=root
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/usr/java14/bin
LC__FASTMSG=true
LOGNAME=root
MAIL=/usr/spool/mail/root
LOCPATH=/usr/shdb/nls/loc
USER=root
AUTHSTATE=compat
SHELL=/usr/bin/ksh
DMDIR=/etc/objrepos
HOME=/
TERM=vt100
MAILMSG=[YOU HAVE NEW MAIL]
PWD=/
TZ=BEIST-8
A__z=! LOGNAME
NLSPATH=/usr/shdb/nls/msg/%L/%N:/usr/shdb/nls/msg/%L/%N.cat
发现SHELL对应的变量为/usr/bin/ksh,而我写的脚本却是#! /bin/ksh
至此找的了问题所在!