LinuxSir.cn,穿越时空的Linuxsir!

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

9.1的奇怪问题?关于./命令和sh命令!

[复制链接]
发表于 2004-6-21 17:19:16 | 显示全部楼层 |阅读模式
1.想安装某一应用程序时,在suse以前的版本或FC等版本时,在终端输入
./path/install  (假定install为安装执行程序,为shell 脚本)
,以前均可以正常进行安装,但在9.1下当用./命令时,不是出现没有这个文件或目录就是说permission undefined,这是怎么回事?我又使用 sh命令,这就更奇怪了,(先保证 shell文件没有错误),这在9.1下用sh命令却显示shell文件有许多行(不详述了)有许多语法或格式错误,但这在FC2、MDK10上均正常运行,这是什么原因呢?
发表于 2004-6-21 17:41:13 | 显示全部楼层
“permission undefined”,权限不够……
“./”不是命令……
也许这个shell脚本是需要tcsh、ksh解释,而非bourne shell(sh)
 楼主| 发表于 2004-6-21 20:23:14 | 显示全部楼层
谢谢,可我这是用root用户运行安装程序呀,这是其中一个setup的文件,大牛们帮忙看看,不是suse9.1的任一个版本都可以正常安装运行呀!

改正:上面不是用./,而是直接写path/setup
仍会出现permission defined的问题!

setup:
………………………………………………………………
#! /bin/csh -f
set cmd = $0
set setup_dir = $cmd:h
set my_cwd = $cwd
cd $setup_dir
set setup_dir = $cwd
cd $my_cwd


if ( "$setup_dir" == "$my_cwd" ) then
  echo "***ERROR. The installation should not be executed from "
  echo "          the directory that contains the setup files."
  echo "          Please change your current working directory and"
  echo "          rerun the installation."
  exit 1
endif


#cwd is default installation directory
if ( `echo $my_cwd | grep -c ^\/` && -d $my_cwd ) setenv IA_CWD $my_cwd

if ( ! $?DISPLAY ) then
  echo ""
  echo "In order to run the installation GUIs, the environment variable"
  echo "DISPLAY must be set. Please set DISPLAY as desired and run this"
  echo "setup script again."
  echo ""
  exit 1
endif

set plat_temp = `uname -a`


if ( `echo $plat_temp | grep -ic hp-ux` ) then
  echo "***WARNING:  Special patches to support RockRidge extensions may be required to "
  echo "             successfully read the data from this CD. (Failure to read the data "
  echo "             properly may result in an error message indicating that Java"
  echo "             libraries could not be found.)  Depot files that contain the patches to "
  echo "             resolve this issue have been included on the ABAQUS Product and "
  echo "             Licensing CD for HP-UX in the file hp_mount.tar.  "
  echo ""
  echo "             This issue has been documented as bug number v64_516 and ABAQUS "
  echo "             answer ID number 950. Please refer to this documentation for more "
  echo "             information. "
  echo ""
  echo "Hit <ENTER> to continue with the installation."
  echo ""
  set response = $<
endif


if ( `echo $plat_temp| grep -ic aix ` ) then
  set plat = 'ibm'
else if ( `echo $plat_temp| grep -ic OSF`) then
  set  plat = 'u_alpha'
else if ( `echo $plat_temp| grep -ic irix `) then
  set  plat = 'origin2000'
else if ( `echo $plat_temp| grep -ic linux`) then
  set  plat = 'linux32'
else if ( `echo $plat_temp| grep -ic hp-ux`) then
  set  plat = 'hp64'
else
  echo ""
  echo "lease choose the platform to install:"
  echo "   1.  Compaq Tru64 5.1"
  echo "   2.  IBM AIX 5.1"
  echo "   3.  SGI IRIX 6.5"
  echo "   4.  Intel Pentium Linux"
  echo "   5.  HP-UX 11 "
  echo ""
  echo -n 'Provide number associated with selection: '
  set ans = $<
  if      ( $ans == "1" ) then
    set plat = 'u_alpha'
  else if ( $ans == "2" ) then
    set plat = 'ibm'
  else if ( $ans == "3" ) then
    set plat = 'origin2000'
  else if ( $ans == "4" ) then
    set plat = 'linux32'
  else if ( $ans == "5" ) then
    set plat = 'hp64'
  else
    echo "***ERROR\! Option $ans is invalid."
    exit 1
  endif
endif

set path = ( $setup_dir/JVM/$plat/jre/bin $path )
setenv ABAQUS_PLAT "$plat"




if ($plat == "hp64" ) then
  if ( ! -e $setup_dir/UNIX/install.bin ) then
    echo "***ERROR: $setup_dir/UNIX/install.bin not found."
    echo "          Please ensure that you have mounted the installation CD"
    echo "          with the correct mount command, which is:"
    echo "                   mount -rt cdfs device /cdrom "
    echo "          where device is the CD-ROM device on your system.  Also,"
    echo "          make sure that the cdcase option has not been included"
    echo "          in your mount command in the sytem file /etc/fstab."
    echo ""
    exit 1
  endif
endif



if ( ! -e $setup_dir/JVM/$plat/jre/bin ) then
  echo "***ERROR: $setup_dir/JVM/$plat/jre/bin not found"
  exit 1
else if ( ! -e $setup_dir/UNIX/install.bin ) then
  echo "***ERROR:  $setup_dir/UNIX/install.bin not found"
  exit 1
endif



#Compaq JVM is too verbose
if ( $plat == "u_alpha" ) then
  set status = `$setup_dir/UNIX/install.bin >& /dev/null`
else
  set status = `$setup_dir/UNIX/install.bin `
endif
发表于 2004-6-21 20:55:21 | 显示全部楼层
最初由 chenhu 发表
#! /bin/csh -f
set cmd = $0
set setup_dir = $cmd:h
set my_cwd = $cwd
cd $setup_dir
set setup_dir = $cwd
cd $my_cwd


1.这个脚本可执行吗?如果不是,chmod +x <文件名>
2.从脚本中可以看出是c shell的脚本,试试csh <文件名>(此时此文本文件不一定是可执行的)
 楼主| 发表于 2004-6-21 21:20:36 | 显示全部楼层
谢谢您!
首先说明这个脚本在fc下和mdk下均可以正常执行,但在这里就没办法执行!

我去试试,再次感谢你的热心!

另,我当热行 /path/setup时,出现的是/bin/sh!
permission defined!
发表于 2004-6-21 22:43:01 | 显示全部楼层
chenhu兄是在安装ABAQUS还是ABAQUSHELP,文件是在硬盘上吗?
如果是SUSE自动加载的VFAT分区,则权限有问题,尽管是在ROOT下.你把这些文件复制到LINUX的分区上再安装则没有问题了.
    我在SUSE9.1下ABAQUS装上了,但HELP死活装不上,另外ANSYS也装上了,但运行时提示: 不能连接到服务器.请指点一二.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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