博客
关于我
shell取值分割后的每个字段赋值给变量
阅读量:88 次
发布时间:2019-02-25

本文共 462 字,大约阅读时间需要 1 分钟。

????????DNS????ttl?IP????????????????

??????????

???????bash?????????????????????????

#!/bin/bashdeclare -a arra="www.baidu.com A 300 192.168.1.1"for i in $(echo "$a" | awk '{print $3,$4}') do    arr[index]=$i    ((index++))doneecho "ttl: ${arr[0]}"echo "ip address: ${arr[1]}"

????????????????

??????eval??

??????eval??????????????????????????

#!/bin/bashb=""c=""eval "$(echo "$a" | awk '{ printf("b=%s;c=%s",$3,$4)}')"echo "$b"echo "$c"

????????????ttl?IP?????

转载地址:http://tca.baihongyu.com/

你可能感兴趣的文章
Qt高级——Qt元对象系统源码解析
查看>>
qt调用vs2008编写的dll动态库(隐式调用)
查看>>
Qt读取注册表默认值
查看>>
poj 1679 判断MST是不是唯一的 (次小生成树)
查看>>
POJ 1703 Find them, Catch them
查看>>
POJ 1703 Find them, Catch them 并查集
查看>>
POJ 1738 An old Stone Game(石子合并)
查看>>
POJ 1740 A New Stone Game(博弈)题解
查看>>
Qt网络编程之实例二POST方式
查看>>
POJ 1765 November Rain
查看>>
poj 1860 Currency Exchange
查看>>
POJ 1961 Period
查看>>
POJ 2019 Cornfields (二维RMQ)
查看>>
poj 2057 The Lost House 贪心思想在动态规划上的应用
查看>>
poj 2057 树形DP,数学期望
查看>>
poj 2112 最优挤奶方案
查看>>
Qt编写自定义控件12-进度仪表盘
查看>>
SpringBoot主启动原理在SpringApplication类《第六课》
查看>>
poj 2186 Popular Cows :求能被有多少点是能被所有点到达的点 tarjan O(E)
查看>>
POJ 2186:Popular Cows Tarjan模板题
查看>>