+ -
当前位置:首页 → 问答吧 → 怎样写一个shell脚步的安装程序命令?

怎样写一个shell脚步的安装程序命令?

时间:2010-01-10

来源:互联网

现在有a,b,c三个文件夹,手动安装方法是进入各个文件夹,打开终端,第一步 输入./configure +回车  第二步  make+回车   第三步 make install+回车。现在要怎样写个install.sh的shell脚步,让它能在终端里直接输入./install.sh就能自动安装。希望高手能不吝赐教!非常感谢!!

作者: ypb455360299   发布时间: 2010-01-10

帮顶

作者: checked   发布时间: 2010-01-10

  1. cd /path/to/a
  2. ./configure && make && make install
  3. cd /path/to/b
  4. ./configure && make && make install
  5. cd /path/to/c
  6. ./configure && make && make install
复制代码
或者,假设 a、b、c 三个目录都在同一个目录下(比如 /root 下),那么:
  1. for d in a b c; do cd /root/$d; ./configure && make && make install; done
  2. 或者
  3. cd /root
  4. for d in a b c; do cd $d; ./configure && make && make install; cd -; done
复制代码

作者: acrofox   发布时间: 2010-01-10

嗯,搭车学习了

作者: child7   发布时间: 2010-01-11

cd /path/to/a
./configure && make && make install
cd /path/to/b
./configure && make && make install
cd /path/to/c 
./configure && make && make install
这个挺好

作者: sl41984   发布时间: 2010-01-15

其实,最简单就是把你把有要执行的命令
全部写到一个文件里。然后执行文本就可以了。

作者: hdandan   发布时间: 2010-04-24

child7


ding

作者: jasonlv   发布时间: 2011-07-20

学习了

作者: every_why   发布时间: 2011-07-22