From 766fd9b749b62c31152ed60385a3b0e3ce1f8958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Wed, 6 Apr 2022 20:21:18 +0200 Subject: [PATCH] Add ISO/examenes/tema10 --- 1/ISO/examenes/tema10-naortega/prob1-1.sh | 2 ++ 1/ISO/examenes/tema10-naortega/prob1-2.sh | 2 ++ 1/ISO/examenes/tema10-naortega/prob1-3.sh | 2 ++ 1/ISO/examenes/tema10-naortega/prob1-4.sh | 3 +++ 1/ISO/examenes/tema10-naortega/prob1-5.sh | 9 +++++++++ 1/ISO/examenes/tema10-naortega/prob2.sh | 7 +++++++ 1/ISO/examenes/tema10-naortega/prob3.sh | 4 ++++ 1/ISO/examenes/tema10-naortega/prob4.sh | 18 ++++++++++++++++++ 8 files changed, 47 insertions(+) create mode 100755 1/ISO/examenes/tema10-naortega/prob1-1.sh create mode 100755 1/ISO/examenes/tema10-naortega/prob1-2.sh create mode 100755 1/ISO/examenes/tema10-naortega/prob1-3.sh create mode 100755 1/ISO/examenes/tema10-naortega/prob1-4.sh create mode 100755 1/ISO/examenes/tema10-naortega/prob1-5.sh create mode 100755 1/ISO/examenes/tema10-naortega/prob2.sh create mode 100755 1/ISO/examenes/tema10-naortega/prob3.sh create mode 100755 1/ISO/examenes/tema10-naortega/prob4.sh diff --git a/1/ISO/examenes/tema10-naortega/prob1-1.sh b/1/ISO/examenes/tema10-naortega/prob1-1.sh new file mode 100755 index 0000000..132739c --- /dev/null +++ b/1/ISO/examenes/tema10-naortega/prob1-1.sh @@ -0,0 +1,2 @@ +#!/bin/bash +echo "Se han introducido $# argumentos." diff --git a/1/ISO/examenes/tema10-naortega/prob1-2.sh b/1/ISO/examenes/tema10-naortega/prob1-2.sh new file mode 100755 index 0000000..35581b4 --- /dev/null +++ b/1/ISO/examenes/tema10-naortega/prob1-2.sh @@ -0,0 +1,2 @@ +#!/bin/bash +echo "Argumento 1: $1" diff --git a/1/ISO/examenes/tema10-naortega/prob1-3.sh b/1/ISO/examenes/tema10-naortega/prob1-3.sh new file mode 100755 index 0000000..0e44913 --- /dev/null +++ b/1/ISO/examenes/tema10-naortega/prob1-3.sh @@ -0,0 +1,2 @@ +#!/bin/bash +echo "Argumento 2: $2" diff --git a/1/ISO/examenes/tema10-naortega/prob1-4.sh b/1/ISO/examenes/tema10-naortega/prob1-4.sh new file mode 100755 index 0000000..051dcff --- /dev/null +++ b/1/ISO/examenes/tema10-naortega/prob1-4.sh @@ -0,0 +1,3 @@ +#!/bin/bash +PROD=$(expr $1 \* $2) +echo "Producto $1*$2=$PROD" diff --git a/1/ISO/examenes/tema10-naortega/prob1-5.sh b/1/ISO/examenes/tema10-naortega/prob1-5.sh new file mode 100755 index 0000000..40ce2ee --- /dev/null +++ b/1/ISO/examenes/tema10-naortega/prob1-5.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +if [ $# -lt 3 ] +then + echo "Se precisan al menos 3 argumentos." + exit 1 +fi + +for i in $@; do echo "$i"; done diff --git a/1/ISO/examenes/tema10-naortega/prob2.sh b/1/ISO/examenes/tema10-naortega/prob2.sh new file mode 100755 index 0000000..d6a6f10 --- /dev/null +++ b/1/ISO/examenes/tema10-naortega/prob2.sh @@ -0,0 +1,7 @@ +#!/bin/bash +if [[ -n $1 ]] +then + echo $1 +else + echo "No hay argumentos." +fi diff --git a/1/ISO/examenes/tema10-naortega/prob3.sh b/1/ISO/examenes/tema10-naortega/prob3.sh new file mode 100755 index 0000000..05f2992 --- /dev/null +++ b/1/ISO/examenes/tema10-naortega/prob3.sh @@ -0,0 +1,4 @@ +#!/bin/bash +mkdir -p ~/dir1 ~/dir3/dir21 +mkdir -p ~/dir4/dir31 +mkdir ~/dir2 diff --git a/1/ISO/examenes/tema10-naortega/prob4.sh b/1/ISO/examenes/tema10-naortega/prob4.sh new file mode 100755 index 0000000..5560d7c --- /dev/null +++ b/1/ISO/examenes/tema10-naortega/prob4.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# a) +ls /dev/tty?? +# b) +ls /etc/[^t]* +# c) +ps | sort +# d) +wc -l /etc/passwd +# e) +ln -s /usr/dir1 /home/usuario/enlacedir1 +# f) +cp -r /bin/u* /home/usuario/enlacedir1/ +# g) +chmod a-w /home/usuario +# h) +cat /etc/motd