随笔分类 -  shell

摘要:#!/bin/bash while read F do cp ${F}"_pe_1.fastq.gz" /public/home/chenjy/usr/ZD/data/cleandata cp ${F}"_pe_2.fastq.gz" /public/home/chenjy/usr/ZD/data/cleandata done < list.txt 阅读全文
posted @ 2017-03-25 11:41 陆离可 阅读(160) 评论(0) 推荐(0)
摘要:&&&&&&&&&&&&&&&&&&&&&&&&&&&&代码渣渣奋斗中&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&am 阅读全文
posted @ 2017-02-21 10:40 陆离可 阅读(140) 评论(0) 推荐(0)
摘要:解释: 1. 文件描述符0通常是标准输入(STDIN,终端),1 是标准输出(STDOUT,终端),2 是标准错误输出(STDERR)。 2. 如果希望 stderr 追加到 file 文件末尾,可以这样写 command 2 >> file 3. 如果希望将 stdout 和 stderr 合并后 阅读全文
posted @ 2017-02-20 16:15 陆离可 阅读(174) 评论(0) 推荐(0)
摘要:# 函数必须在使用前定义 # 如果不写return,将以最后一条命令运行结果,作为返回值。 return后跟数值n(0-255) myFistFunc(){ read a read b return $(($a+$b))} # 调用时直接写函数名字,不要加括号myFistFunc # $?获得函数的 阅读全文
posted @ 2017-02-20 15:47 陆离可 阅读(178) 评论(0) 推荐(0)
摘要:××××××××××××××××××××IF-ELSE××××××××××××××××××××××××××××× 阅读全文
posted @ 2017-02-20 12:57 陆离可 阅读(161) 评论(0) 推荐(0)
摘要:#1. shell 基本运算符有:算数、关系、布尔、字符串、文件测试运算符#2. 原生bash不支持简单的数学运算,可使用awk和expr(最常用)echo `expr 1 + 2`# 反引号;表达式和运算符之间要有空格,例如 2+2 是不对的a=1b=2# + - * / % = == !=ech 阅读全文
posted @ 2017-02-20 09:58 陆离可 阅读(138) 评论(0) 推荐(0)
摘要:××××××××××××××××××××××××××××××下面是echo××××××××××××××××××× 阅读全文
posted @ 2017-02-19 22:11 陆离可 阅读(232) 评论(0) 推荐(0)
摘要:#在执行shell脚本时,带参数,如./test.sh 1 2 3,则在脚本test.sh内,参数表示为$n的形式,$1为第一个参数,以此类推。 echo "第一个参数为:$1"; echo "参数个数为:$#"; echo "传递的参数作为一个字符串显示:$*"; 阅读全文
posted @ 2017-02-19 22:01 陆离可 阅读(155) 评论(0) 推荐(0)
摘要:#!/bin/bash # online test tool: http://www.shucunwang.com/RunCode/shell/ name="pxy"#Attention for variables' names:#1. No space between "name" and "=" 阅读全文
posted @ 2017-02-19 21:45 陆离可 阅读(172) 评论(0) 推荐(0)
摘要:1. Shell is a program written in C. It provides an interface for users to access to the service of os kernal. Windows Explorer is a typical graphic in 阅读全文
posted @ 2017-02-19 21:43 陆离可 阅读(249) 评论(0) 推荐(0)