2016年10月10日

shell while的用法

摘要: 1. #!/bin/shint=1while (( "$int < 10" ))doecho "$int"let "int++"done 2.#!/bin/sh sum=0int=1 while (( "$int < 100" ))dolet "sum+=int"let "int+=2" donee 阅读全文

posted @ 2016-10-10 10:17 猫儿爹 阅读(25408) 评论(0) 推荐(0) 编辑

2016年10月9日

python 函数对象

摘要: 在展开之前,我们先提一下lambda函数。可以利用lambda函数的语法,定义函数。lambda例子如下: 函数可以作为一个对象,进行参数传递。函数名(比如func)即该对象。比如说: map()是Python的内置函数。它的第一个参数是一个函数对象。 reduce()函数 reduce函数的第一个 阅读全文

posted @ 2016-10-09 16:52 猫儿爹 阅读(185) 评论(0) 推荐(0) 编辑

python 中zip函数的使用

摘要: ta = [1,2,3]tb = [9,8,7] # clusterzipped = zip(ta,tb)print(zipped) # decomposena, nb = zip(*zipped)print(na, nb) 阅读全文

posted @ 2016-10-09 16:34 猫儿爹 阅读(4081) 评论(0) 推荐(0) 编辑

spark 单机版安装

摘要: jdk-8u73-linux-x64.tar.gz hadoop-2.6.0.tar.gz scala-2.10.6.tgz spark-1.6.0-bin-hadoop2.6.tgz jdk-8u73-linux-x64.tar.gz hadoop-2.6.0.tar.gz scala-2.10. 阅读全文

posted @ 2016-10-09 12:42 猫儿爹 阅读(3915) 评论(0) 推荐(0) 编辑

shell for的用法

摘要: #!/bin/sh for1(){ for i in 1 2 3 4 5 6do echo "$i"done } for1#!/bin/shfor2(){for i in {1..10}doecho "$i" done } for2#!/bin/sh for3(){ sum=0#int=1 for 阅读全文

posted @ 2016-10-09 11:08 猫儿爹 阅读(2817) 评论(0) 推荐(0) 编辑

2016年10月8日

shell 实现闰年的判断

摘要: #!/bin/shecho "please input the year"read year let "n1=$year % 4"let "n2=$year % 100"let "n3=$year % 400" if [ "$n1" -ne 0 ]then let "flag=0"elif [ "$ 阅读全文

posted @ 2016-10-08 10:50 猫儿爹 阅读(1653) 评论(0) 推荐(0) 编辑

2016年9月30日

java实现sendemail

摘要: <dependency> <groupId>com.sun.mail</groupId> <artifactId>javax.mail</artifactId> <version>1.5.2</version> </dependency> //mailinfo package com.auto.te 阅读全文

posted @ 2016-09-30 16:20 猫儿爹 阅读(538) 评论(0) 推荐(0) 编辑

2016年9月28日

shell split函数的使用

摘要: #!/bin/awk -f BEGIN{FS=","} {split($1,name," "); for (i in name) print name[i] } 阅读全文

posted @ 2016-09-28 10:06 猫儿爹 阅读(2331) 评论(0) 推荐(0) 编辑

shell实现文件内容查询如输入姓名结果显示电话号码等信息

摘要: #!/bin/awk -f BEGIN{FS=","; if(ARGC>2){name=ARGV[1];delete ARGV[1]} else{ echo "please enter name";getline name<"-" } } $1~name {print $1,$3} 阅读全文

posted @ 2016-09-28 10:02 猫儿爹 阅读(290) 评论(0) 推荐(0) 编辑

使用sort&awk实现文件内容块排序

摘要: 源文件为: [root@luo5 wangxx]# cat -v luo.txt J LuoSoutth jfsaNanjing,china Y ZhangVictory UniversityNejflja,Australia D HouBeijing UniversityMelhouse,chin 阅读全文

posted @ 2016-09-28 09:57 猫儿爹 阅读(2980) 评论(0) 推荐(0) 编辑

导航