shell script

shell scripts examples. Resolved exercises

1. Make a script that checks if the current user of the system is manolo, if so greet him, if not say goodbye.


2. Make a script to check if today is the 25th, if so show «October 25 FU FU FU».


3. I have a keyword in a file. Make a script that shows if the word is «myfpschool» or not.


4. Make a script that checks if the second column of a file containing only one line contains the word myfpschool.


5. Make a script that checks if the first three columns of a file (which contains only one line) are identical or different.


6. Do the same thing but considering that the file is compressed with gzip.


7. I have a three files tar. Make a script that creates a file toatoa.gz with the lines of the three files that contains the string «Te nesecito».


8. I have a personahes.gz file containing two columns < name country>. You want to know the name of the citizens of «chiquitistan». File Example:
John holland
Pedro chiquitistan
Ramiro russia
Josue denmark


9. You are asked to make a script that shows the lines of a file containing either the words «uno»and «dos», no matter without going in case.


10. Idem but the previous file containing the word «a» at the beginning of sentences.


Deja una respuesta

Tu dirección de correo electrónico no será publicada.

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.