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: Linux
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…
vim/vi – Insérer du texte dans un bloc sélectionné
C’est une petite astuce, mais très utile, surtout lorsque vous éditez du code sur un serveur. Une tâche que nous faisons souvent lorsque nous vérifions et nettoyons le code est de commenter de très grandes parties du script, peut-être un bloc entier d’une boucle ou quelque chose de similaire. Dans bash, les commentaires commencent par…
vim/vi – Insert text in a selected block
This is a short tip, but very useful, mostly for when you are editing code in a server. One task that we do often when we are checking and cleaning the code is to comment very big parts of the script, maybe an entire block of a loop or something similar. In bash the comments…