不同输出结果如何取相同的变量值?
时间:2011-01-31
来源:互联网
$2取到 v5.3.2a或v5.2.3 该如何实现?
swd77:admin> firmwareshow
Appl Primary/Secondary Versions
------------------------------------------
FOS v6.0.1a
v5.3.2a
或
swd77:admin> firmwareshow
Primary version: v5.2.3
Secondary version: v5.2.3
作者: chinaboywg 发布时间: 2011-01-31
作者: chinaboywg 发布时间: 2011-01-31
要求2个结果套用一个表达式
作者: chinaboywg 发布时间: 2011-01-31
var2=`ur_cmd | awk 'NF{s=$NF}END{print s}'`
作者: ywlscpl 发布时间: 2011-01-31
回复 chinaboywg
var1=`command|awk '{if(/FOS/){print $NF}else{if(/Primary/){print $NF}}}'`
var2=`command|awk '/FOS/{next}/Secondary/{next}END{print $NF}'`
作者: yinyuemi 发布时间: 2011-01-31
作者: chinaboywg 发布时间: 2011-01-31
swd77:admin> firmwaredownload
Server Name or IP Address: 172.16.16.16
User Name: root
File Name: ./v6.2.2b/release.plist
Network Protocol(1-auto-select, 2-FTP, 3-SCP) [1]: 2
Password:
Checking system settings for firmwaredownload...
Server IP: 172.16.16.16, Protocol IPv4
System settings check passed.
You can run firmwaredownloadstatus to get the status
of this command.
This command will cause a warm/non-disruptive boot on the switch,
but will require that existing telnet, secure telnet or SSH sessions
be restarted.
Do you want to continue [Y]: y
Firmware is being downloaded to the switch. This step may take up to 30 minutes.
Preparing for firmwaredownload...
Removing fabos-drivers
Start to install packages...
或
swd77:admin> firmwaredownload
Server Name or IP Address: 172.16.16.16
FTP User Name: root
File Name: ./v5.3.2a/release.plist
FTP Password:
Verifying the input parameters ...
Checking system settings for firmwaredownload...
You can run firmwaredownloadstatus to get the status
of this command.
This command will cause a warm/non-disruptive boot on the switch,
but will require that existing telnet, secure telnet or SSH sessions
be restarted.
Do you want to continue [Y]: y
Firmware is being downloaded to the switch. This step may take up to 30 minutes.
Preparing for firmwaredownload...
Removing wget-1.5.3-1
Removing ftp-0.17-1
Removing lkcd-4.1_1_2.4.19-1
Removing ncftp-3.0.3-3
Removing binutils-libs-2.10.1-1
Removing fabos-fw-5.2.3-8
Removing binutils-2.10.1-1
Removing mmlib-1.1.3-1
Removing fabos-diagdev-5.2.3-10
Start to install packages...
区别就是一个有2,一个没有2
而且还要用expect实现,如何弄?
作者: chinaboywg 发布时间: 2011-01-31
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28