高性能计算

折腾intel集群工具包-续

2008年11月12日 阅读(256)

linux下bash脚本文件的运行
上回说到,当星星敲入install.sh时,屏幕上突然出现一大片的error,今天接着折腾
duanple@duanple-desktop:~/l_ict_p_3.0.1.008$ sudo ./install.sh
./install.sh: 6: declare: not found
./install.sh: 7: [[: not found
./install.sh: 8: declare: not found
./install.sh: 9: declare: not found
./install.sh: 11: declare: not found
./install.sh: 12: declare: not found
./install.sh: 13: declare: not found
./install.sh: 14: Syntax error: "(" unexpected

这不,我有得重新翻看intel的安装文档,发现有个步骤要用到rpm,赶紧检查自己的系统,发现果然没装,先装上再说。
1.rpm
sudo apt-get install rpm
2.
写个简单的sh文件测试一下,如下
test.sh
#!/bin/sh
## Copyright(C) 2004-2007, Intel Corporation, All Rights Reserved.
## This script installs Intel(R) Cluster Toolkit for Linux.
##
LANGUAGE=en_US
declare SCRIPT=$( basename "$0" 2>/dev/null )
echo "test"

执行
duanple@duanple-desktop:~$ sudo ./test.sh
发现
sudo: ./test.sh: 没有文件执行权限
2.3查看修改文件权限
ls -l
chmod a+x test.sh
chmod命令格式如下:
chmod [o,g,u,a][+,-][r,w,x,-] file.**
o表示other,g表示group,u表示user,a表示all
2.4
duanple@duanple-desktop:~$ ./test.sh
./test.sh: 6: declare: not found
出现同样错误,修改方法:
把#!/bin/sh改成#!/bin/bash
3.duanple@duanple-desktop:~/l_ict_p_3.0.1.008$ ./install.sh
ERROR: Unable to find command "gawk". Please add the location of the command
ERROR: to your PATH and re-run the script.
ok,安装gawk
duanple@duanple-desktop:~/l_ict_p_3.0.1.008$ sudo apt-get install gawk

4.终于可以安装了
duanple@duanple-desktop:~/l_ict_p_3.0.1.008$ ./install.sh
Software packages that are installed using RPMs are available system-wide.
We recommend that you install the software using RPM (option 1).
This would require a root password.

If you do not have the root password, you can do a local installation in your
home folder by choosing option 2 below.

Which of the following would you like to do?
    1. Install the software using RPM (root password required) – Recommended.
    2. Install the software without using RPM database (root password not
       required).
    x. Exit.

Please make a selection: (1/2/x) [1]:

5.安装到中间,又有问题了,原来在它安装过程中的解压文件中
又出现了install.sh这样的文件,而且同样是#!/bin/sh
这下,又得找半天解决方法了
初步设想的方法:
1.修改它的temp文件
2.删除/bin/sh把文件/bin/bash改成/bin/sh

You Might Also Like