Skip to content
Snippets Groups Projects
Commit f0e33ea8 authored by Walmes Zeviani (@octa)'s avatar Walmes Zeviani (@octa)
Browse files

arquivo com dicas.

parent a6936725
No related branches found
No related tags found
No related merge requests found
---
output:
knitrBootstrap::bootstrap_document:
theme: Flatly
highlight: Solarized - Light
theme.chooser: TRUE
highlight.chooser: TRUE
---
```{r setup, include=FALSE, purl=FALSE}
##----------------------------------------------------------------------
## Knitr settings. Do not run.
library(knitr)
library(knitrBootstrap)
library(rmarkdown)
opts_chunk$set(
bootstrap.show.message=FALSE,
bootstrap.show.error=FALSE,
bootstrap.show.warning=FALSE)
options(width=70)
```
<center>
****
<h1>
Dicas de Linux
</h1>
[Walmes Zeviani](http://leg.ufpr.br/~walmes/ "email: walmes@ufpr.br")
<img src="http://orig13.deviantart.net/3976/f/2013/206/1/9/simple_linux_logo_by_dablim-d5k4ghu.png">
</center>
****
## Procura e sustituição de texto
```{r, eval=FALSE, engine="bash"}
##----------------------------------------------------------------------
grep -r --include=*.R 'texto_buscado' *
##----------------------------------------------------------------------
sed -i 's/texto_antigo/texto_novo/g' arquivo.txt
sed 's/texto_antigo/texto_novo/g' arquivo.txt
sed 's/texto_antigo/texto_novo/g' input.txt > output.txt
sed -i 's/texto_antigo/texto_novo/g' *.txt
##----------------------------------------------------------------------
## Trocar texto dentro de um arquivo. O texto 'walmes' será substituido
## por 'zeviani' dentro do arquivo experII.R
perl -i -pe 's/walmes/zeviani/;' experII.R
##----------------------------------------------------------------------
## Lista onde existe 90 tracos seguidos.
egrep '\-{90}' aula7.R
##----------------------------------------------------------------------
## Se uma linha excede 77 traços deixe apenas 77.
sed 's/\(\-\{77\}\).*/\1/g' arquivo.txt
##----------------------------------------------------------------------
## Fazer isso em todos os aquivos de extensão R.
sed -i 's/\(\-\{77\}\).*/\1/g' *.R
##----------------------------------------------------------------------
## Substituí o texto `green!30!black` por `darkgreen` dentro do
## diretório para arquivos com extensão `*.pgf`.
grep -rl 'green!30!black' *.pgf | \
xargs sed -i 's/green!30!black/darkgreen/g'
##----------------------------------------------------------------------
## Remove os "_" (underlines) do nome dos arquivos e subtitui por
## espaços " ".
find -type f -exec rename 'y/\_/\ /' {} \;
##----------------------------------------------------------------------
## Remove o espaço antes de .pdf nos arquivos.
find -type f -exec rename 's/\ \./\./' {} \;
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment