This entry is a quick tip about Bash shell. Many times I want to remove (rm), copy (cp), move (mv) or do other things (cat, head, etc.) to all files in a directory, except to a particular one or ones. If there are few files in a directory, it is not a big problem. But…
Category: bash
Groups for cross validation
This post is for people that are interested in cross-validation or need, for any reason, to create random groups to perform some analysis. Some years ago, I had to do cross-validation and received from Ignacio Aguilar a simple and efficient tip using awk. To create random groups in a data set you can use the…
Loops. General view. For do loops.
Another suggestion of my colleague in the office. He asked me about loops in R. But I decided to do a more general post, because loops are structures that you will find in every programming language. So it is interesting to understand how they work and then apply the concept to a specific language. Loops…
bash – Arguments de script (Addendum)
Comme je pense que c’est plus facile de supprimer que d’écrire, j’ai fait un script pour démarrer les scripts avec la boucle while pour getopts déjà écrite. Alors, si je n’ai pas besoin d’utiliser des arguments, je dois juste supprimer le bloc. Je l’ai sauvegardé dans mon dossier /bin sous le nom de mkscript.sh. Je…
bash – Script arguments (Addendum)
As I think that is easier delete than write, I did a script to start scripts with the while loop for getopts already written. Then, if I don’t need to use arguments I just have to delete the block. I called it mkscript.sh and I saved it in my /bin folder. The way to use…