图片alt
pid=$(jps | grep "bioinfo-0.0.1-SNAPSHOT.jar" | awk '{print $1}')
read -p "input a word :" word if [ ! -n "$word" ] ;then echo "you have not input a word!" else echo "the word you input is $word" fi
#!/bin/bash if [ ! -n "$1" ] ;then echo "you have not input a word!" else echo "the word you input is $1" fi
#!/bin/sh para1= if [ ! $para1 ]; then echo "IS NULL" else echo "NOT NULL" fi
#!/bin/sh dmin= if test -z "$dmin" then echo "dmin is not set!" else echo "dmin is set !" fi
#!/bin/sh dmin= if [ "$dmin" = "" ] then echo "dmin is not set!" else echo "dmin is set !" fi
#!/usr/bin/env bash Link="http://www.ncbi.nlm.nih.gov/pubmed/" PMCLink="http://www.ncbi.nlm.nih.gov/pmc/articles/" ID=(33719338 77777777) for f in ${ID[@]}; do echo "${Link}${f}" PMCID=$(wget --user-agent="Mozilla/5.0 (Windows NT 5.2; rv:2.0.1) Gecko/20100101 Firefox/4.0.1" \ -l1 --no-parent ${Link}${f} -O - 2>/dev/null | grep -Po 'PMC\d+' | head -n 1) echo "$PMCID" if [ $PMCID ]; then wget --user-agent="Mozilla/5.0 (Windows NT 5.2; rv:2.0.1) Gecko/20100101 Firefox/4.0.1" \ -l1 --no-parent -A.pdf ${PMCLink}${PMCID}/pdf/ -O ${f}.pdf 2>/dev/null else echo "No PMC ID for $f" fi done
#!/usr/bin/env bash Link="http://www.ncbi.nlm.nih.gov/pubmed/" PMCLink="http://www.ncbi.nlm.nih.gov/pmc/articles/" # ID=(33719338 77777777) PID=$1 if ! test $PID ;then echo "please input PID!" exit fi OUT_NAME=$PID if test $2; then OUT_NAME=$2 fi echo "downlaod: ${Link}${PID} - ${OUT_NAME}" PMCID=$(wget --user-agent="Mozilla/5.0 (Windows NT 5.2; rv:2.0.1) Gecko/20100101 Firefox/4.0.1" \ -l1 --no-parent ${Link}${PID} -O - 2>/dev/null | grep -Po 'PMC\d+' | head -n 1) echo "$PMCID" if [ $PMCID ]; then wget --user-agent="Mozilla/5.0 (Windows NT 5.2; rv:2.0.1) Gecko/20100101 Firefox/4.0.1" \ -l1 --no-parent -A.pdf ${PMCLink}${PMCID}/pdf/ -O ${OUT_NAME}.pdf 2>/dev/null else echo "No PMC ID for $PID" fi
if [ ! -d "/data/" ];then mkdir /data else echo "文件夹已经存在" fi
if [ ! -f "/data/filename" ];then echo "文件不存在" else rm -f /data/filename fi