一起学习网 一起学习网


vtune自动安装脚本分享

网络编程 vtune自动安装脚本分享 06-21

#!/bin/bash
#!/usr/bin/expect -f
#!/usr/bin/env bash
yum install -y expect wget
cd /root
wget http://172.16.92.99/share/tar/vtune_amplifier_xe_2013_update15.tar.gz
wget http://172.16.92.99/share/tar/EVAL_L_VT__VGXB-RDCJPN8X.lic
tar -zxvf vtune_amplifier_xe_2013_update15.tar.gz
expect -c "spawn sh /root/vtune_amplifier_xe_2013_update15/install.sh;
set timeout 5; expect "*Enter*"; send "rn";
expect "*Enter*"; send "rn";
expect "*Enter*"; send "rn";
while {1} {
expect {
"*--More--*" {send "rn"}
"*accept*" {break}
}
}
expect "*accept*"
send "accept\r"
expect "*selection*";send "3\r";
expect "*choice*"; send "2\r";
send "/root/EVAL_L_VT__VGXB-RDCJPN8X.lic"
expect "*Enter*"; send "rn";
expect "*selection:*"; send "1\r";
expect "*Enter*"; send "rn";
set timeout 25;
expect "*Enter*"; send "rn";
expect "*Enter*"; send "rn";
expect eof;"
rm -rf /root/*
source /opt/intel/vtune_amplifier_xe_2013/amplxe-vars.sh

shell获取命令行参数示例分享
#!/bin/bashwhilegetoptsa:bcoptdocase$optina)echo"aaa"echo$OPTARGb)echo"bb"c)echo"ccc"*)echo"error"esacdone

把mysql查询结果保存到文件的shell脚本
该脚本是先删除已经存在的文件,然后后台执行SQL语句将其执行结果以一定的格式写入文件#!/bin/bashif[-f"/var/lib/mysql/hell.txt"];thenrm-f/var/lib/mysql/hell.txtecho"d

利用管道实现sudo命令免输入密码的方法
笔者由于学习php,在linux下边也装了一个xampp的集成环境包。但是每次启动的时候都要进入终端,然后依次点开/opt/lampp/,然后sudo执行manager-linux-x64.run操


编辑:一起学习网

标签:文件,脚本,都要,将其,终端