Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR ejercicio 2 #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ej2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# Concatene en una linea una funcion para que imprima por
# pantalla los usuarios del sistema tomando los datos de **/etc/passwd**

cut -d":" -f1 /etc/passwd
10 changes: 10 additions & 0 deletions ej3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# Concatene en una linea una funcion para que imprima por
# pantalla los usuarios del sistema tomando los datos de **/etc/passwd**

# 3. Modifique dicho script para filtrar solo la linea del usuario
# especificado en la linea de comando al ser ejecutado. Ej: **./filtro.sh** unsam


cat /etc/passwd | grep $1
15 changes: 15 additions & 0 deletions ej4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

# 4. Utilizando el archivo ([guid_to_fix.csv](./guid_to_fix.csv)) cree un script que genere un archivo llamado guid.csv como se muestra debajo:
# ```
# 908abc0f-8d37-45e4-ac3f-b9711c353204
# 61b0f4ce-c1a4-4ed1-9d66-effc71335ef0
# e098c4f8-2133-46ae-a13d-e9bc6bfad6aa
# 4d87f99b-b113-4645-9ab2-80dd3371ee60
# e8d2d1a4-80ef-463b-89f6-ccaf5947331d
# ad1b093b-7559-40c3-9f02-a7df301afd7a
# ...
# ```

cut -d'"' -f4 guid_to_fix.csv >> guid.csv

sed -i '1d' guid.csv
3 changes: 3 additions & 0 deletions ej5.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 5. Cree un script que cambie el prompt del bash luego de ejecutarlo

export PS1="\s-\v\$"
4 changes: 4 additions & 0 deletions ej7.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 7. Cree un script **mono_con_navaja.sh** que elija un archivo al azar de una
# carpeta y pregunte al usuario si desea eliminarlo o no.

ls | cat
Loading