转载:https://github.com/swcarpentry/DEPRECATED-boot-camps/blob/master/shell/shell_cheatsheet.md
1、For loop
list[0]=Sam
list[1]=Lynne
list[2]=Dhavide
list[3]=Trevor
for varname in ${list[@]}
do
echo $varname
done
2、While Loop
COUNTER=0
while [ ${COUNTER} -lt 10 ]; do
command 1
command 2
COUNTER=`expr ${COUNTER} + 1`
done
3、grep
grep -v -A1 -w -Ff gene_id gene.fa