码迷,mamicode.com
首页 >  
搜索关键字:awk sort    ( 17174个结果)
linux脚本随笔-01
#### 获取配置文件配置路径,javapath为配置项,var为具体的配置值eval $(awk -F "javapath=" '{if($2=="") {print $2} else {print "var="$2}}' 1.sh)echo $var#####计算MD5值file=1.shmd5...
分类:系统相关   时间:2014-11-20 18:32:05    阅读次数:168
鸟书shell 学习笔记(二) shell中正则表达式相关
通配符与正则表达式的区别 通配符是bash原生支持的语法+表格 语系设置 : export LANG=C grep alias 设置 : grep --color=auto 正则表达式是处理字符串的一种表示方式, 正则表达式需要支持的工具支持才可以 通配符: 正则: 拓展正则: grep 的一些高级参数...
分类:系统相关   时间:2014-11-20 17:08:38    阅读次数:225
快速排序
#include #include #include #include #include using namespace std; /* *快速排序问题 */ void Fast_sort(vector& a,int beg,int end) { if(beg+1>=end) return; int key = beg; for (int i = beg , j = end; i < j;...
分类:编程语言   时间:2014-11-20 13:42:12    阅读次数:201
PAT 1067 Sort with Swap(0,*)
#include #include #include using namespace std;int swap(vector &numpos, int va, int vb) { //printf("swap(%d at %d, %d at %d)\n", va, numpos[va], vb...
分类:其他好文   时间:2014-11-20 01:17:41    阅读次数:349
接口与内部类
这个月已过去大半了,都没怎么学习Java。事情多也不能当做借口,按部就班地学习吧。接口中的所有方法自动地属于public。因此,在借口中声明方法时,不必提供关键字public。接口绝不能含有实例域,也不能在接口中实现方法。为了使用Arrays类的sort方法对Employee对象数组进行排序,Emp...
分类:其他好文   时间:2014-11-19 23:48:56    阅读次数:269
Java数据结构与排序
一、引子:想要给ArrayList排序却发现没有排序方法?你有两种选择: 1、换用TreeSet; 2、使用Collection.sort(List list) / Collection.sort(List list, Comparator c)方法。二、展开分析Java的几种主要...
分类:编程语言   时间:2014-11-19 23:34:24    阅读次数:315
shell脚本字符串截取
shell字符串的截取的问题:一、Linux shell 截取字符变量的前8位,有方法如下: 1.expr substr “$a” 1 8 2.echo $a|awk ‘{print substr(,1,8)}’ 3.echo $a|cut -c1-8 4.expr $a : ‘\(.\\)...
分类:系统相关   时间:2014-11-19 21:55:33    阅读次数:314
awk使用方法
1.awk中引用外部变量,有三种方式awk 'pattern{action}' file1)awk '{print a,b}' a=111 b=222 file,此时BEGIN模块无法用该变量2) awk -v a=111 b=222 '{print a,b}' file3) a=111;b="网页...
分类:其他好文   时间:2014-11-19 21:49:29    阅读次数:126
【Leetcode】Remove Duplicates from Sorted List in JAVA
Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2, return 1->2. Given 1->1->2->3->3, return 1->2->3. 思路很简单,由于乖乖的sort好了,就是判断下...
分类:编程语言   时间:2014-11-19 18:51:28    阅读次数:242
linux常用文字处理命令总结
linux常用文字处理命令...
分类:系统相关   时间:2014-11-19 18:41:26    阅读次数:189
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!