随笔分类 -  shell日常练习

摘要:employee文件中记录了工号和姓名 employee.txt: 100 Jason Smith 200 John Doe 300 Sanjay Gupta 400 Ashok Sharma bonus文件中记录工号和工资 bonus.txt: 100 $5,000 200 $500 300 $3 阅读全文
posted @ 2018-10-13 16:43 徐~某~某 阅读(509) 评论(0) 推荐(0)
摘要:用shell处理以下内容 1、按单词出现频率降序排序! 2、按字母出现频率降序排序! the squid project provides a number of resources toassist users design,implement and support squid installa 阅读全文
posted @ 2018-10-11 16:50 徐~某~某 阅读(142) 评论(0) 推荐(0)
摘要:原文出处: "https://www.jianshu.com/p/855c9fb373ff" Shell 里面的方括号(包括单中括号与双中括号)可用于以下三种情况的判断: 1. 算术比较。 比如一个变量是否为0, [ $var eq 0 ] 2. 文件属性测试。比如一个文件是否存在,[ e $var 阅读全文
posted @ 2018-10-11 16:08 徐~某~某 阅读(382) 评论(0) 推荐(0)
摘要:判断网址是否正常 !/bin/bash array=( www.baidu.com www.sohu.com www.google.com www.helloworldxhn.com ) for url in ${array[ ]} do res_code=$(curl I m 2 $url 2 / 阅读全文
posted @ 2018-10-11 15:32 徐~某~某 阅读(289) 评论(0) 推荐(0)