Gerador de cabeçalho

Publicado por Mauriciodez (última atualização em 10/12/2018)

[ Hits: 10.109 ]

Download 6923.gera_cabecalho.sh




Script para inserção de cabeçalho em novo script ou em existente.

Link do projeto: https://github.com/mauriciodez/gera_cabecalho.git

Licença GPLv3.

  



Esconder código-fonte

#!/bin/bash

#####   NOME:            gera_cabecalho.sh
#####   VERSÃO:            1.0
#####   DESCRIÇÃO:         Insere cabeçalhos em novos scripts ou em existentes.
#####   DATA DA CRIAÇÃO:           09/12/2018
#####   ESCRITO POR:              Maurício G. Paiva
#####   E-MAIL:            mauriciodez@gmail.com
#####   DISTRO:            Debian GNU/Linux 8 (jessie)
#####   LICENÇA:                 GPLv3
#####   PROJETO:                 https://github.com/mauriciodez/gera_cabecalho.git

TR="#####"
USER="Maurício G. Paiva"
EMAIL="mauriciodez@gmail.com"
GIT="https://github.com/mauriciodez/"
VS="GPLv3"

TXT2   ()   {
         sed -i "2s,^,\n$TR\tNOME:\t\t\t\t$(echo $ARQ)\n$TR\tVERSÃO:\t\t\t\t1.0\n$TR\tDESCRIÇÃO:\t\t\t$descricao \
         \n$TR\tDATA DA CRIAÇÃO:\t$(date +"%d/%m/%Y")\n$TR\tESCRITO POR:\t\t$USER\n$TR\tE-MAIL:\t\t\t\t$EMAIL \
         \n$TR\tDISTRO:\t\t\t\t$(cat /etc/*-release|head -1|awk -F'"' '{print $2}')\n$TR\tLICENÇA:\t\t\t$VS \
         \n$TR\tPROJETO:\t\t\t$GIT$(echo $ARQ|cut -d'.' -f1)\n," $ARQ
         }

x="s"
while [ 1 ];
do

clear && ls *.sh
   echo -e "Qual o arquivo que deseja modificar ? [ENTER] para novo arquivo"
      read ARQ

   if [ -z $ARQ ];then
      echo "Mode de criação"
      read -p "Insira o nome para o novo arquivo -> " ARQ
         if [ `echo $ARQ | cut -d'.' -f2` != "sh" ];then
            ARQ=`echo "$ARQ.sh"`
         fi
            echo -e "#!/bin/bash\n" > $ARQ
            read -p "Insira a descrição do script -> " descricao
            TXT2
            chmod +x $ARQ
         else

      if [ `echo $ARQ | cut -d'.' -f2` != "sh" ];then
         ARQ=`echo "$ARQ.sh"`
      fi

         if [ -e "$ARQ" ];then
            read -p "Insira a descrição do script -> " descricao
            TXT2
         else
            echo "Arquivo não encontrado quer fazer de novo ? ENTER ou 's'"
            read resposta
               if [ $resposta != $x ]; then
                  exit
               fi
         fi
   fi
done

Scripts recomendados

Script para configuracao rapida da eth0

Salvar link favorito

arquivoAoAlvo.sh

suspender ou hibernar por dialog

Cotáção do Dólar


  

Comentários

Nenhum comentário foi encontrado.


Contribuir com comentário




Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts