Posts by MrPaper • 51 points
4 posts
-
1
votes3
answers3932
viewsA: How do you configure phpmyadmin on linux?
Installing using apt-get, in some versions of Ubuntu/Ubuntu server it is necessary to directly add the phpmyadmin path in the apache configuration file, so type in the terminal: vim…
-
2
votes2
answers2307
viewsA: Delete all lines that have a specific string
I made a quick solution here, then I add a more "polished". sed -n '/DiffTable/,/<\/p>/p' arquivo.html |grep -q Excluído && sed '/"DiffTable"/,/<\/p>/{//!d}' arquivo.html || echo…
-
1
votes2
answers1858
viewsA: Shell script Sed read one file and write to another only on the first occurrence of a string
If it’s just to find an occurrence, without substitutions or many conditions for this match to be true, I would use the grep. grep -o -a -m 1 -h "pasta" teste.txt > report.html Parameters: -o =…
-
1
votes3
answers280
viewsA: Make a shell script bash that extracts to a new file all names and nr of women whose number starts with "91"
Another way and that you can adapt in other cases, would be using the awk. cat ficheiro1.txt|awk -F ";" '{if (($2 == "Feminino") && ($4 ~ /^93/)) print $1,$4}' > novoficheiro.txt…