Last active
February 8, 2023 21:40
-
-
Save cfbastarz/ef3910eb0dff62852f0ed75661ff5a27 to your computer and use it in GitHub Desktop.
Cria arquivos em reStruturedText a partir dos nomes dos diretórios em um determinado local. Os nomes dos arquivos são em caixa baixa e o cabeçalho do arquivo é escrito de acordo com o nome do diretório encontrado.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Considerando que os diretórios estão organizados da seguinte forma: | |
# Albedo | |
# AlbedoClima | |
# Chopping | |
# etc | |
# | |
# Linguagem: Bash | |
# @cfbastarz | |
for i in $(find . -maxdepth 1 -type d) | |
do | |
name1=$(echo $i | awk -F "./" '{print $2}') | |
name2=$(echo $name1 | tr "[:upper:]" "[:lower:]") | |
len=$(echo $name1 | wc -c) | |
eval printf "=%.0s" {1..$len} > ./doc/processos/${name2}.rst | |
printf "\n$name1\n" >> ./doc/processos/${name2}.rst | |
eval printf "=%.0s" {1..$len} >> ./doc/processos/${name2}.rst | |
echo "$name1 - $name2 - $len" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment