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.

EJ1

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

ej2

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

EX3

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

Ex4

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

ej5

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

ej6

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».

EJ7

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

EJ8

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.

EJ9

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

ej10

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.