diff --git a/.gitignore b/.gitignore index 7cecf2f2a1e81828a7cb793122fc09bdc97c943f..2599fc8564960b07c40823842ea020435d4c0403 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ ./nomes-de-bebes/ +./PubMed/ +./Sinonimos/ diff --git a/tshell/tshell_p1.sh b/tshell/tshell_p1.sh old mode 100644 new mode 100755 index a9bf588e2f88457fdf73ac7361ef1d596fb81453..c601ea16429b2c89c2056a1908d6f897ddcd0da3 --- a/tshell/tshell_p1.sh +++ b/tshell/tshell_p1.sh @@ -1 +1,29 @@ #!/bin/bash + +if [ $# -lt 3 ] || [ $# -gt 5 ]; then + >&2 echo "Uso: <dpm> <ds> <t1> [<t2> [<t3>]]" + exit 1 +fi + +FONTE=$1 +DESTINO=$2 +T1=$3 +T2=$4 +T3=$5 + +if [ ! -d $FONTE ]; then + >&2 echo "Erro: $FONTE não é um diretório." + exit 1 +fi + +if [ ! -d $DESTINO ]; then + mkdir $DESTINO +fi + +DESTINO=$(realpath $DESTINO) + +cd $FONTE +for ARQ in *; do + awk '(NR>1)' $ARQ | grep -iF "$T1" | grep -iF "$T2" | grep -iF "$T3" > $DESTINO/$ARQ +done +cd - > /dev/null diff --git a/tshell/tshell_p2.sh b/tshell/tshell_p2.sh old mode 100644 new mode 100755 diff --git a/tshell/tshell_p3.sh b/tshell/tshell_p3.sh old mode 100644 new mode 100755