-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
308 lines (308 loc) · 180 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
<!DOCTYPE html>
<!-- saved from url=(0037)https://wiwagner8462.github.io/3Trim/ -->
<html class="js-focus-visible dark" data-js-focus-visible="" style="color-scheme: dark;"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><script>!function(){try {var d=document.documentElement.classList;d.remove('light','dark');var e=localStorage.getItem('theme');if("system"===e||(!e&&true)){var t="(prefers-color-scheme: dark)",m=window.matchMedia(t);m.media!==t||m.matches?d.add('dark'):d.add('light')}else if(e) d.add(e)}catch(e){}}()</script><title>3º Trimestre</title><meta name="apple-mobile-web-app-capable" content="yes"><meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"><meta property="twitter:card" content="summary_large_image"><meta property="og:title" content="3º Trimestre"><meta property="twitter:title" content="3º Trimestre"><meta property="og:type" content="website"><meta property="og:image" content="https://notaku.website/api/images/https~~3A~~2F~~2Fimages.unsplash.com~~2Fphoto-1508830524289-0adcbe822b40~~3Fixlib~~3Drb-1.2.1~~26q~~3D85~~26fm~~3Djpg~~26crop~~3Dentropy~~26cs~~3Dsrgb?wrapWithNotionId=3e8e1fa2-d7e1-441c-975f-dc4f43470b23"><link rel="icon" href="https://notaku.website/[email protected]"><link rel="shortcut icon" href="https://notaku.website/[email protected]"><meta name="next-head-count" content="12"><meta name="next-font-preconnect"><link rel="preload" href="./index_files/ce848504221a9eeb.css" as="style"><link rel="stylesheet" href="./index_files/ce848504221a9eeb.css" data-n-g=""><noscript data-n-css=""></noscript><script defer="" nomodule="" src="./index_files/polyfills-5cd94c89d3acac5f.js.descarga"></script><script src="./index_files/webpack-342e47b961ca189f.js.descarga" defer=""></script><script src="./index_files/framework-dfe7900087b3b8d3.js.descarga" defer=""></script><script src="./index_files/main-b743a41e6e969dd2.js.descarga" defer=""></script><script src="./index_files/_app-4f490c612c67db7d.js.descarga" defer=""></script><script src="./index_files/712-8e9b7a6480d8ea52.js.descarga" defer=""></script><script src="./index_files/448-4d0e9a6d10737764.js.descarga" defer=""></script><script src="./index_files/[host]-05438905c2dfb8db.js.descarga" defer=""></script><script src="./index_files/_buildManifest.js.descarga" defer=""></script><script src="./index_files/_ssgManifest.js.descarga" defer=""></script><script src="./index_files/_middlewareManifest.js.descarga" defer=""></script><style id="__jsx-940187512">#nprogress{pointer-events:none;}#nprogress .bar{background:#3B82F6;position:fixed;z-index:9999;top:0;left:0;width:100%;height:4px;}#nprogress .peg{display:block;position:absolute;right:0px;width:100px;height:100%;box-shadow:0 0 10px #3B82F6,0 0 5px #3B82F6;opacity:1;-webkit-transform:rotate(3deg) translate(0px,-4px);-ms-transform:rotate(3deg) translate(0px,-4px);-webkit-transform:rotate(3deg) translate(0px,-4px);-ms-transform:rotate(3deg) translate(0px,-4px);transform:rotate(3deg) translate(0px,-4px);}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px;}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:solid 2px transparent;border-top-color:#3B82F6;border-left-color:#3B82F6;border-radius:50%;-webkit-animation:nprogresss-spinner 400ms linear infinite;-webkit-animation:nprogress-spinner 400ms linear infinite;animation:nprogress-spinner 400ms linear infinite;}.nprogress-custom-parent{overflow:hidden;position:relative;}.nprogress-custom-parent #nprogress .spinner,.nprogress-custom-parent #nprogress .bar{position:absolute;}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg);}100%{-webkit-transform:rotate(360deg);}}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}100%{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}@keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}100%{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}</style></head><body><style id="__jsx-940187512">#nprogress{pointer-events:none;}#nprogress .bar{background:#3B82F6;position:fixed;z-index:9999;top:0;left:0;width:100%;height:4px;}#nprogress .peg{display:block;position:absolute;right:0px;width:100px;height:100%;box-shadow:0 0 10px #3B82F6,0 0 5px #3B82F6;opacity:1;-webkit-transform:rotate(3deg) translate(0px,-4px);-ms-transform:rotate(3deg) translate(0px,-4px);-webkit-transform:rotate(3deg) translate(0px,-4px);-ms-transform:rotate(3deg) translate(0px,-4px);transform:rotate(3deg) translate(0px,-4px);}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px;}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:solid 2px transparent;border-top-color:#3B82F6;border-left-color:#3B82F6;border-radius:50%;-webkit-animation:nprogresss-spinner 400ms linear infinite;-webkit-animation:nprogress-spinner 400ms linear infinite;animation:nprogress-spinner 400ms linear infinite;}.nprogress-custom-parent{overflow:hidden;position:relative;}.nprogress-custom-parent #nprogress .spinner,.nprogress-custom-parent #nprogress .bar{position:absolute;}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg);}100%{-webkit-transform:rotate(360deg);}}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}100%{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}@keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}100%{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}</style><div id="__next"><div class="only-one-page"><div class="relative w-full h-full mx-auto overflow-x-visible visibleInPrint" style="max-width:var(--max-width)"><div class="flex items-stretch w-full h-full overflow-x-visible"><div class="sidenav-bg"></div><nav class="relative overflow-x-visible flex flex-col overflow-y-scroll pb-6 px-2 overflow-y-auto text-sm sidenav hiddenInPrint" aria-label="Main navigation"><a class="navLink !font-semibold my-[4px] min-h-[2.2em] select-none rounded-sm inline-flex overflow-x-visible w-full group relative font-medium items-start outline-none cursor-pointer select-none py-[0.4em] text-black dark:text-white" href="https://iso_3t.notaku.site/"><div class="absolute inset-0 flex -left-2 rounded-md group-hover:opacity-100 dark:group-hover:bg-gray-800 group-hover:bg-gray-200 bg-gray-200 dark:bg-gray-800 opacity-100"></div><div class="navIcon"><img alt="icon" src="./index_files/bash.png"></div><div class="relative flex-1">3º Trimestre</div></a><div class="flex-1"></div><div class="mt-10 text-xs tracking-wide opacity-70"><span class="">Powered by </span><a class="font-medium" href="https://notaku.website/" target="_blank">Notaku</a></div></nav><div class="flex flex-col flex-1 min-w-0 overflow-hidden mainContent"><h1 class="font-semibold text-4xl mx-0 mb-6 tracking-tight whitespace-pre-wrap group flex whitespace-pre-wrap text-gray-700 dark:text-gray-100 !mt-0" id="3e8e1fa2d7e1441c975fdc4f43470b23" style="margin-top:0"><a href="https://iso_3t.notaku.site/#3e8e1fa2d7e1441c975fdc4f43470b23" class="absolute opacity-0 after:content-['#'] group-hover:opacity-100" style="margin-left:-0.9em;padding-right:0.5em;box-shadow:none;color:#a1a1aa" aria-label="Anchor"></a><span>3º Trimestre</span></h1><main class="notion space-y-4 notionContent dark-mode notion-page 3e8e1fa2d7e1441c975fdc4f43470b23"><div style="background-color:var(--notion-gray_background)" class="notion-callout border flex space-x-3 p-4 rounded-md fe441d34714b4c779deb5116b6307ab5"><span class="notion-page-icon m-2 mt-0 h-5 w-5 " role="img" aria-label="🔍">🔍</span><div class="break-words whitespace-pre-wrap notion-callout-text min-w-0"><b class="font-bold text-gray-700 dark:text-gray-100">COMANDOS DE PROCESOS Y FILTROS<!-- --></b><div class="notion-text w-full whitespace-pre-wrap break-words 46c83e966f754a5eb891ab9db033d7e2">Para ver los procesos que se están ejecutando en Ubuntu utilizamos el comando <!-- --><span style="background-color:var(--notion-teal_background)"><b class="font-bold text-gray-700 dark:text-gray-100">ps -fea
<!-- --></b></span>Para parar un proceso se utiliza el comando<!-- --><b class="font-bold text-gray-700 dark:text-gray-100"> <!-- --></b><span style="background-color:var(--notion-teal_background)"><b class="font-bold text-gray-700 dark:text-gray-100">kill PID<!-- --></b></span><b class="font-bold text-gray-700 dark:text-gray-100"> <!-- --></b>(identificador del proceso)
Para forzar su detención se usa el comando:<!-- --><div class="flex flex-col notion-text-children "><div class="notion-text w-full whitespace-pre-wrap break-words 83b631f3538341d4acbe2ddec647b5f9"><span style="background-color:var(--notion-teal_background)"><b class="font-bold text-gray-700 dark:text-gray-100">kill -9 PID<!-- --></b></span></div></div></div></div></div><div style="background-color:var(--notion-gray_background)" class="notion-callout border flex space-x-3 p-4 rounded-md 2d64215b554d440c8af17204763398ab"><span class="notion-page-icon m-2 mt-0 h-5 w-5 " role="img" aria-label="📥">📥</span><div class="break-words whitespace-pre-wrap notion-callout-text min-w-0"><b class="font-bold text-gray-700 dark:text-gray-100">REDIRECCIONAMIENTO<!-- --></b><div class="notion-text w-full whitespace-pre-wrap break-words dd9c414b0ab9431e92dd48854a3767fb">Para redireccionar la salida de la información, utilizamos <!-- --><span style="background-color:var(--notion-teal_background)">><!-- --></span>
Nos cambiará nuestra salida de información a un archivo de texto, por ejemplo.
Con <!-- --><span style="background-color:var(--notion-teal_background)">><!-- --></span> la información que haya en el archivo se <!-- --><span style="background-color:var(--notion-red_background)">SOBREESCRIBE<!-- --></span>.
Con <!-- --><span style="background-color:var(--notion-teal_background)">>><!-- --></span> la información se sigue escribiendo al final del archivo.<!-- --></div></div></div><div style="background-color:var(--notion-gray_background)" class="notion-callout border flex space-x-3 p-4 rounded-md 39a982475cc14bc2b27a1467de7615aa"><span class="notion-page-icon m-2 mt-0 h-5 w-5 " role="img" aria-label="🌐">🌐</span><div class="break-words whitespace-pre-wrap notion-callout-text min-w-0"><b class="font-bold text-gray-700 dark:text-gray-100">OTROS COMANDOS<!-- --></b><div class="notion-text w-full whitespace-pre-wrap break-words 236617eca86142aab42a5ea3121137a8">WGET<!-- --></div><div class="notion-text w-full whitespace-pre-wrap break-words d9e5b5e6d05f466e85280c9683d20268"><b class="font-bold text-gray-700 dark:text-gray-100">Ejercicio:<!-- --></b>
Ejecuta un comando para mostrar los 10 primeros músicos de la lista de los 40 Principales.
<!-- --><span style="background-color:var(--notion-teal_background)">Wget https://los40.com/lista40/<!-- --></span><div class="flex flex-col notion-text-children "><div class="notion-text w-full whitespace-pre-wrap break-words c668e5d0f2944539a6df56601925ba0d"><span style="background-color:var(--notion-teal_background)">Grep nombre_artista index.html | cut -d “ “ -f 7 | head<!-- --></span></div></div></div></div></div><div style="background-color:var(--notion-gray_background)" class="notion-callout border flex space-x-3 p-4 rounded-md f3ab3153b348435cbad33e9886f6704b"><span class="notion-page-icon m-2 mt-0 h-5 w-5 " role="img" aria-label="📌">📌</span><div class="break-words whitespace-pre-wrap notion-callout-text min-w-0"><b class="font-bold text-gray-700 dark:text-gray-100">SCRIPTS<!-- --></b><div class="notion-text w-full whitespace-pre-wrap break-words 7518ca6246474a398e9ad1f37cdb13c6">Los scripts son un programa simple, que generalmente se crean en un archivo de texto.<!-- --><div class="flex flex-col notion-text-children "><div class="notion-text w-full whitespace-pre-wrap break-words b43e59981d344aeb949e6586dea80830">Para que los scripts funcionen se debe poner en su primera línea:<!-- --></div><blockquote class="notion-quote whitespace-pre-wrap break-words w-full border-solid border-l-4 pl-4 border-current 4446e90451734adab2e7502b74912c86"><b class="font-bold text-gray-700 dark:text-gray-100">#!/bin/bash<!-- --></b></blockquote></div></div></div></div><div style="background-color:var(--notion-gray_background)" class="notion-callout border flex space-x-3 p-4 rounded-md ba67929a08d44c269eab99fe712398a5"><span class="notion-page-icon m-2 mt-0 h-5 w-5 " role="img" aria-label="🖥️">🖥️</span><div class="break-words whitespace-pre-wrap notion-callout-text min-w-0"><b class="font-bold text-gray-700 dark:text-gray-100">SCRIPT CON ECHO<!-- --></b><div class="notion-text w-full whitespace-pre-wrap break-words add082abc4ed4735b642e4f8e1198f34">El comando <!-- --><b class="font-bold text-gray-700 dark:text-gray-100"><span style="color:var(--notion-orange)">echo<!-- --></span></b> nos sacará por pantalla la información que introduzcamos entre comillas<!-- --><div class="flex flex-col notion-text-children "><div class="notion-text w-full whitespace-pre-wrap break-words e1a5cba0fc6442b3bb0412953f4c8bd5">Ejemplo: Script saludando<!-- --></div><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#Linea que sera ignorada
echo <span class="token string">"Hola"</span>
echo <span class="token string">"Soy un script"</span>
echo <span class="token string">"salu2"</span></code></pre></div><div class="notion-text w-full whitespace-pre-wrap break-words 84faf8e37ed04ea7873111aea6821556">Hay que darle permisos de ejecución.
Para ejecutarlo: <!-- --><span style="background-color:var(--notion-teal_background)">./saludos.sh<!-- --></span> o <!-- --><span style="background-color:var(--notion-teal_background)">source saludos.sh<!-- --></span> sin Permisos.<!-- --></div></div></div></div></div><div style="background-color:var(--notion-gray_background)" class="notion-callout border flex space-x-3 p-4 rounded-md 6a7caa6f24764172a4c1033a0ec03f70"><span class="notion-page-icon m-2 mt-0 h-5 w-5 " role="img" aria-label="📦">📦</span><div class="break-words whitespace-pre-wrap notion-callout-text min-w-0"><b class="font-bold text-gray-700 dark:text-gray-100">SCRIPT CON VARIABLES (I)<!-- --></b><div class="notion-text w-full whitespace-pre-wrap break-words 6d2db5cc63d94bbea796a901f78d6f85">Las variables nos guardan el valor en una caja, puede ser de texto o número. Para crear una variable, tenemos que escribir <!-- --><b class="font-bold text-gray-700 dark:text-gray-100">nombrevariable=valor<!-- --></b> (kilos=80)<!-- --><div class="flex flex-col notion-text-children "><div class="notion-text w-full whitespace-pre-wrap break-words 0b56cea74e6e41ceac45ab9b5eecc051">Para hacer referencia a una variable tenemos que escribirla con el símbolo $ delante. (<!-- --><span style="color:var(--notion-purple)"><b class="font-bold text-gray-700 dark:text-gray-100">$nombre<!-- --></b></span><b class="font-bold text-gray-700 dark:text-gray-100">)<!-- --></b></div><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#Ejercicio <span class="token number">1</span> de las variables
nombre<span class="token operator">=</span>Evelyn
edad<span class="token operator">=</span><span class="token number">18</span>
estatura<span class="token operator">=</span><span class="token number">1.60</span>
echo <span class="token string">"Hola me llamo $nombre , tengo $edad años y mido $estatura"</span></code></pre></div></div></div><div class="notion-text w-full whitespace-pre-wrap break-words 34a81a44300e4a988d8da07f7d232285"><b class="font-bold text-gray-700 dark:text-gray-100">SCRIPT CON VARIABLES (II)<!-- --></b></div><div class="notion-text w-full whitespace-pre-wrap break-words 16c01d87aa9a4b728953256e3e4fc348">Para hacer operaciones con variables, debemos de crear una variable de esta manera:<!-- --><div class="flex flex-col notion-text-children "><blockquote class="notion-quote whitespace-pre-wrap break-words w-full border-solid border-l-4 pl-4 border-current b3b68912b01c4dfdb5ce8f04be59689e"><span style="color:var(--notion-blue)"><b class="font-bold text-gray-700 dark:text-gray-100">suma=$[$num1 + $num2]<!-- --></b></span></blockquote><div class="notion-text w-full whitespace-pre-wrap break-words f4e4db0c4c1e4330bafc22a16a02e489">Ejemplo: suma de datos en una variable.<!-- --></div><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#ejercicio variables <span class="token number">2</span>
dato1<span class="token operator">=</span><span class="token number">5</span>
dato2<span class="token operator">=</span><span class="token number">2</span>
suma<span class="token operator">=</span>$<span class="token punctuation">[</span>$dato1<span class="token operator">+</span>$dato2<span class="token punctuation">]</span>
echo <span class="token string">"El resultado de sumar $dato1 y $dato2 es $suma"</span></code></pre></div></div></div><div class="notion-text w-full whitespace-pre-wrap break-words b2e61edb45c944d08d6d217e0bd91a9f"><b class="font-bold text-gray-700 dark:text-gray-100">SCRIPT CON VARIABLES (III)<!-- --></b></div><div class="notion-text w-full whitespace-pre-wrap break-words 070c7d4c7e2c424795e6616072f94f5f">Para realizar diferentes operaciones, debemos de escribir lo mismo pero con el signo correspondiente:<!-- --><div class="flex flex-col notion-text-children "><div class="notion-text w-full whitespace-pre-wrap break-words 791b46e9ba1c4e1cbedc0c84b13a3350"><span style="color:var(--notion-blue)"><b class="font-bold text-gray-700 dark:text-gray-100">resta=$[$num1 - $num2]
division=$[$num1 / $num2]
multiplicacion=$[$num1 * $num2]
cociente=$[$num1 % $num2]<!-- --></b></span></div><div class="notion-text w-full whitespace-pre-wrap break-words 9376ad24b6ab4a1ca2a9fae404d6ed88">Ejemplo: realizando varias operaciones en variables.<!-- --><div class="flex flex-col notion-text-children "><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#Ejercicio <span class="token number">3</span> de variables
dato1<span class="token operator">=</span><span class="token number">5</span>
dato2<span class="token operator">=</span><span class="token number">2</span>
suma<span class="token operator">=</span>$<span class="token punctuation">[</span>$dato1 <span class="token operator">+</span> $dato2<span class="token punctuation">]</span>
resta<span class="token operator">=</span>$<span class="token punctuation">[</span>$dato1 <span class="token operator">-</span> $dato2<span class="token punctuation">]</span>
multiplicacion<span class="token operator">=</span>$<span class="token punctuation">[</span>$dato1 <span class="token operator">*</span> $dato2<span class="token punctuation">]</span>
division<span class="token operator">=</span>$<span class="token punctuation">[</span>$dato1 <span class="token operator">/</span> $dato2<span class="token punctuation">]</span>
echo <span class="token string">"El resultado de la suma de $dato1 y $dato2 es $suma"</span>
echo <span class="token string">"El resultado de la resta de $dato1 y $dato2 es $resta"</span>
echo <span class="token string">"El resultado de la multiplicacion de $dato1 y $dato2 es $multiplicacion"</span>
echo <span class="token string">"El resultado de la division de $dato1 y $dato2 es $division"</span></code></pre></div></div></div></div></div></div></div><div style="background-color:var(--notion-gray_background)" class="notion-callout border flex space-x-3 p-4 rounded-md 5d0c21eeceb742d18d9d8e57230d84b9"><span class="notion-page-icon m-2 mt-0 h-5 w-5 " role="img" aria-label="📝">📝</span><div class="break-words whitespace-pre-wrap notion-callout-text min-w-0"><b class="font-bold text-gray-700 dark:text-gray-100">SCRIPT CON READ (INTRODUCIENDO VALORES)<!-- --></b><div class="notion-text w-full whitespace-pre-wrap break-words 9224b08605be4fa583c53504c97f8773">Para que nuestro script pida unos datos al usuario, debemos de crear cajas con el comando <!-- --><span style="color:var(--notion-orange)"><b class="font-bold text-gray-700 dark:text-gray-100">read<!-- --></b></span><b class="font-bold text-gray-700 dark:text-gray-100">. <!-- --></b>Solo tenemos que crear la caja escribiendo<!-- --><b class="font-bold text-gray-700 dark:text-gray-100"> <!-- --></b><span style="color:var(--notion-orange)"><b class="font-bold text-gray-700 dark:text-gray-100">read <!-- --></b></span><span style="color:var(--notion-orange)"><em class="italic"><b class="font-bold text-gray-700 dark:text-gray-100">nombre<!-- --></b></em></span><em class="italic"><b class="font-bold text-gray-700 dark:text-gray-100">. <!-- --></b></em>Para hacer referencia a la caja, también escribiremos <!-- --><span style="color:var(--notion-purple)"><em class="italic"><b class="font-bold text-gray-700 dark:text-gray-100">$nombre<!-- --></b></em></span><div class="flex flex-col notion-text-children "><div class="notion-text w-full whitespace-pre-wrap break-words 22918ff101a7443d8c00dd231b9c16c8">Ejemplo: pide tu nombre, y lo repite.<!-- --></div><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#ejercicio <span class="token number">4</span> de variables introduciendo valores
echo <span class="token string">"Escribe tu nombre"</span>
read nombre
echo <span class="token string">"Hola soy $nombre"</span></code></pre></div></div></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><b class="font-bold text-gray-700 dark:text-gray-100">Ejercicio 1<!-- --></b>: Crea un script que calcule tu edad introduciendo tu año de nacimiento y tu nombre.<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
echo <span class="token operator">-</span>n <span class="token string">"Pon tu año de nacimineto: "</span><span class="token punctuation">;</span> read anno
echo <span class="token operator">-</span>n <span class="token string">"Pon tu Nombre: "</span><span class="token punctuation">;</span> read name
annoA<span class="token operator">=</span><span class="token function">$</span><span class="token punctuation">(</span>date <span class="token operator">+</span><span class="token operator">%</span><span class="token constant">Y</span><span class="token punctuation">)</span>
edad<span class="token operator">=</span>$<span class="token punctuation">[</span>$annoA <span class="token operator">-</span> $anno<span class="token punctuation">]</span>
echo <span class="token string">"Tu edad es de $edad y tu nombre es $name"</span></code></pre></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><b class="font-bold text-gray-700 dark:text-gray-100">Ejercicio 2<!-- --></b>: Crea un script que muestre en el fichero resultado.txt la fecha del sistema y el nombre de los usuarios de nuestro equipo.<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
date<span class="token operator">=</span><span class="token function">$</span><span class="token punctuation">(</span>date <span class="token operator">+</span><span class="token operator">%</span>x<span class="token punctuation">)</span>
hora<span class="token operator">=</span><span class="token function">$</span><span class="token punctuation">(</span>date <span class="token operator">+</span><span class="token operator">%</span><span class="token constant">X</span><span class="token punctuation">)</span>
user<span class="token operator">=</span><span class="token function">$</span><span class="token punctuation">(</span>cut <span class="token operator">-</span>d<span class="token operator">:</span> <span class="token operator">-</span>f1 <span class="token operator">/</span>etc<span class="token operator">/</span>passwd<span class="token punctuation">)</span>
echo "
<span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span>
Fecha<span class="token operator">:</span> $date
Hora<span class="token operator">:</span> $hora
User's<span class="token operator">:</span>
$user" <span class="token operator">>></span> resultado<span class="token punctuation">.</span>txt</code></pre></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><b class="font-bold text-gray-700 dark:text-gray-100">Ejercicio 3<!-- --></b>: Crea un script que muestre en un archivo de texto los procesos que ejecuta un usuario en concreto, en este caso, el usuario ubuntu.<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
ps <span class="token operator">-</span>fea <span class="token operator">|</span> grep ubuntu <span class="token operator">>></span> procesos<span class="token punctuation">.</span>txt <span class="token operator">&&</span> cat procesos<span class="token punctuation">.</span>txt</code></pre></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><b class="font-bold text-gray-700 dark:text-gray-100">Ejercicio 4<!-- --></b>: Modifica el script anterior para que sirva para cualquier usuario.<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
echo <span class="token operator">-</span>n <span class="token string">"¿De que usuario quieres ver los procesos? "</span><span class="token punctuation">;</span> read usuario
ps <span class="token operator">-</span>fea <span class="token operator">|</span> grep $usuario <span class="token operator">>></span> procesos<span class="token punctuation">.</span>txt <span class="token operator">&&</span> cat procesos<span class="token punctuation">.</span>txt</code></pre></div></div></div><hr class="notion-hr w-full border-t border-[var(--fg-color-0)] my-1 5b1ec9660bf94974b2e2d403274591c0"><div style="background-color:var(--notion-gray_background)" class="notion-callout border flex space-x-3 p-4 rounded-md 8a68a652dd2648c69bceb1ec4108f7d1"><span class="notion-page-icon m-2 mt-0 h-5 w-5 " role="img" aria-label="🐧">🐧</span><div class="break-words whitespace-pre-wrap notion-callout-text min-w-0"><b class="font-bold text-gray-700 dark:text-gray-100">SCRIPT CON IF Y ELSE<!-- --></b><div class="notion-text w-full whitespace-pre-wrap break-words dcf8c5950ac14ba79851669025ee2a30">Estuctura:<!-- --><div class="flex flex-col notion-text-children "><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token keyword">if</span> <span class="token punctuation">[</span> <span class="token constant">CONDICIONAL</span> <span class="token punctuation">]</span><span class="token punctuation">;</span>
then #Si es <span class="token boolean">true</span>
elif #Para otra condicional
<span class="token keyword">else</span> #Si es <span class="token boolean">false</span>
fi #<span class="token constant">FIN</span></code></pre></div><h3 class="font-semibold text-xl mx-0 mb-6 whitespace-pre-wrap group flex whitespace-pre-wrap text-gray-700 dark:text-gray-100" id="35cefa646fe54789b7083789f0ee546c" style="margin-top:3rem"><a href="https://iso_3t.notaku.site/#35cefa646fe54789b7083789f0ee546c" class="absolute opacity-0 after:content-['#'] group-hover:opacity-100" style="margin-left:-0.9em;padding-right:0.5em;box-shadow:none;color:#a1a1aa" aria-label="Anchor"></a><span>Expresiones Condicionales<!-- --></span></h3><table class="notion-simple-table min-w-full border border-collapse text-sm rounded-md a4d8a28c626f4ffb86b985ba57015143"><tbody><tr class="notion-simple-table-row 17987969b09e4a68bd1e864c1921c7d0"><td class="border p-2" style="background-color:var(--bg-color-0);font-weight:600;width:228px"><div class="notion-simple-table-cell whitespace-pre-wrap">Sirve<!-- --></div></td><td class="border p-2" style="background-color:var(--bg-color-0);font-weight:600;width:228px"><div class="notion-simple-table-cell whitespace-pre-wrap">Numeros<!-- --></div></td><td class="border p-2" style="background-color:var(--bg-color-0);font-weight:600;width:228px"><div class="notion-simple-table-cell whitespace-pre-wrap">Letras<!-- --></div></td></tr><tr class="notion-simple-table-row 7d24d7238aba42e0acb38cf2de10a4a5"><td class="border p-2" style="width:228px"><div class="notion-simple-table-cell whitespace-pre-wrap"><span style="background-color:var(--notion-teal_background)">true<!-- --></span> si es =<!-- --></div></td><td class="border p-2" style="width:228px"><div class="notion-simple-table-cell whitespace-pre-wrap">-eq<!-- --></div></td><td class="border p-2" style="width:228px"><div class="notion-simple-table-cell whitespace-pre-wrap">=<!-- --></div></td></tr><tr class="notion-simple-table-row 4922d75ea38b4558810f3a5d15156a03"><td class="border p-2" style="width:228px"><div class="notion-simple-table-cell whitespace-pre-wrap"><span style="background-color:var(--notion-teal_background)">true<!-- --></span> si es ≠<!-- --></div></td><td class="border p-2" style="width:228px"><div class="notion-simple-table-cell whitespace-pre-wrap">-ne<!-- --></div></td><td class="border p-2" style="width:228px"><div class="notion-simple-table-cell whitespace-pre-wrap">≠<!-- --></div></td></tr><tr class="notion-simple-table-row 1209a04a5c7b43758565363b641c9d2c"><td class="border p-2" style="width:228px"><div class="notion-simple-table-cell whitespace-pre-wrap"><span style="background-color:var(--notion-teal_background)">true<!-- --></span> si es <<!-- --></div></td><td class="border p-2" style="width:228px"><div class="notion-simple-table-cell whitespace-pre-wrap">-lt<!-- --></div></td><td class="border p-2" style="width:228px"><div class="notion-simple-table-cell whitespace-pre-wrap"></div></td></tr><tr class="notion-simple-table-row 532db2ea463946b786da2dc4c89664f5"><td class="border p-2" style="width:228px"><div class="notion-simple-table-cell whitespace-pre-wrap"><span style="background-color:var(--notion-teal_background)">true<!-- --></span> si es ><!-- --></div></td><td class="border p-2" style="width:228px"><div class="notion-simple-table-cell whitespace-pre-wrap">-gt<!-- --></div></td><td class="border p-2" style="width:228px"><div class="notion-simple-table-cell whitespace-pre-wrap"></div></td></tr><tr class="notion-simple-table-row ed54e4bdf769488f95542e7d901a8e4c"><td class="border p-2" style="width:228px"><div class="notion-simple-table-cell whitespace-pre-wrap"><span style="background-color:var(--notion-teal_background)">true<!-- --></span> si es ≤<!-- --></div></td><td class="border p-2" style="width:228px"><div class="notion-simple-table-cell whitespace-pre-wrap">-le<!-- --></div></td><td class="border p-2" style="width:228px"><div class="notion-simple-table-cell whitespace-pre-wrap"></div></td></tr><tr class="notion-simple-table-row 1cdb47c12e104882846250271c37f08c"><td class="border p-2" style="width:228px"><div class="notion-simple-table-cell whitespace-pre-wrap"><span style="background-color:var(--notion-teal_background)">true<!-- --></span> si es ≥<!-- --></div></td><td class="border p-2" style="width:228px"><div class="notion-simple-table-cell whitespace-pre-wrap">-ge<!-- --></div></td><td class="border p-2" style="width:228px"><div class="notion-simple-table-cell whitespace-pre-wrap"></div></td></tr></tbody></table></div></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap">Mayor y Menor de EDAD<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
echo <span class="token operator">-</span>n <span class="token string">"Pon tu año de nacimineto: "</span><span class="token punctuation">;</span> read anno
echo <span class="token operator">-</span>n <span class="token string">"Pon tu Nombre: "</span><span class="token punctuation">;</span> read name
annoA<span class="token operator">=</span><span class="token function">$</span><span class="token punctuation">(</span>date <span class="token operator">+</span><span class="token operator">%</span><span class="token constant">Y</span><span class="token punctuation">)</span>
edad<span class="token operator">=</span>$<span class="token punctuation">[</span>$annoA <span class="token operator">-</span> $anno<span class="token punctuation">]</span>
echo
<span class="token keyword">if</span> <span class="token punctuation">[</span> $edad <span class="token operator">-</span>ge <span class="token number">18</span> <span class="token punctuation">]</span>
then
echo <span class="token string">"Tu edad es de $edad y tu nombre es $name"</span>
echo <span class="token string">"Eres mayor de edad"</span>
<span class="token keyword">else</span>
echo <span class="token string">"Tu edad es de $edad y tu nombre es $name"</span>
echo <span class="token string">"Eres menor de edad"</span>
fi</code></pre></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap">Contraseña<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
echo <span class="token operator">-</span>n <span class="token string">"Contraseña: "</span><span class="token punctuation">;</span> read pass
echo
<span class="token keyword">if</span> <span class="token punctuation">[</span> $pass <span class="token operator">!=</span> <span class="token number">123456</span> <span class="token punctuation">]</span>
then
echo <span class="token string">"Contraseña correcta ✔️"</span>
<span class="token keyword">else</span>
echo <span class="token string">"Contraseña incorrecta ⛔"</span>
fi</code></pre></div></div></div><hr class="notion-hr w-full border-t border-[var(--fg-color-0)] my-1 a2c9888b613546328f17c56ecdde6eee"><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><b class="font-bold text-gray-700 dark:text-gray-100">Ejercicio 5<!-- --></b>: Crea un script sumando 3 notas (0 al 10), divídelas entre 3 y si el resultado es mayor de 5, que te devuelva un mensaje diciendo que estás aprobado y si no; suspenso.<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
echo <span class="token string">"Introduce tus notas de los examenes"</span>
echo <span class="token operator">-</span>n <span class="token string">"Nota 1: "</span><span class="token punctuation">;</span> read nota1
echo <span class="token operator">-</span>n <span class="token string">"Nota 2: "</span><span class="token punctuation">;</span> read nota2
echo <span class="token operator">-</span>n <span class="token string">"Nota 3: "</span><span class="token punctuation">;</span> read nota3
suma<span class="token operator">=</span>$<span class="token punctuation">[</span>$nota1 <span class="token operator">+</span> $nota2 <span class="token operator">+</span> $nota3<span class="token punctuation">]</span>
division<span class="token operator">=</span>$<span class="token punctuation">[</span>$suma <span class="token operator">/</span> <span class="token number">3</span><span class="token punctuation">]</span>
<span class="token keyword">if</span> <span class="token punctuation">[</span> $division <span class="token operator">-</span>ge <span class="token number">5</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> then
echo <span class="token string">"APROBADO 😁"</span>
<span class="token keyword">else</span>
echo <span class="token string">"SUSPENSO 😔"</span>
fi</code></pre></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><span style="background-color:var(--notion-blue_background)"><b class="font-bold text-gray-700 dark:text-gray-100">EXTRA:<!-- --></b></span> Si el usuario es root tiene todos los permisos, si es un usuari tiene los permisos de ese usiario y si es otro no tiene ningun permiso.<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl">#bin<span class="token operator">/</span>bash
user<span class="token operator">=</span><span class="token function">$</span><span class="token punctuation">(</span>whoami<span class="token punctuation">)</span>
echo <span class="token string">"Usuario: $user"</span>
<span class="token keyword">if</span> <span class="token punctuation">[</span> $user <span class="token operator">=</span> <span class="token string">"root"</span> <span class="token punctuation">]</span>
then
echo <span class="token string">"Tines todos los permisos 🔒"</span>
elif <span class="token punctuation">[</span> $user <span class="token operator">=</span> <span class="token string">"wiwagner8462"</span> <span class="token punctuation">]</span>
then
echo <span class="token string">"Tienes permisos de WiWagner8462 👾"</span>
<span class="token keyword">else</span>
echo <span class="token string">"⛔ Notienes permisos ⛔"</span>
fi</code></pre></div></div></div><div style="background-color:var(--notion-gray_background)" class="notion-callout border flex space-x-3 p-4 rounded-md 55da18f1d6384f3ba03412e9ce6582a4"><span class="notion-page-icon m-2 mt-0 h-5 w-5 " role="img" aria-label="🐧">🐧</span><div class="break-words whitespace-pre-wrap notion-callout-text min-w-0"><b class="font-bold text-gray-700 dark:text-gray-100">SCRIPT CON CASE<!-- --></b><div class="notion-text w-full whitespace-pre-wrap break-words 248e3cfe452848e7bd7ecbd2a048c65a">Estuctura:<!-- --><div class="flex flex-col notion-text-children "><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token keyword">case</span> $num <span class="token keyword">in</span>
<span class="token number">1</span><span class="token punctuation">)</span> aquí escribimos lo que queremos que haga si pulsamos <span class="token number">1.</span> <span class="token punctuation">;</span><span class="token punctuation">;</span>
<span class="token number">2</span><span class="token punctuation">)</span> aquí escribimos lo que queremos que haga si pulsamos <span class="token number">1.</span> <span class="token punctuation">;</span><span class="token punctuation">;</span>
<span class="token operator">*</span><span class="token punctuation">)</span> aquí escribimos lo que queremos que haga si pulsamos cualquier otra tecla<span class="token punctuation">.</span> <span class="token punctuation">;</span> exit <span class="token punctuation">;</span><span class="token punctuation">;</span>
esac</code></pre></div></div></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><b class="font-bold text-gray-700 dark:text-gray-100">Ejercicio 6<!-- --></b>: Crear script de QUINIELA. Podemos meter 1, X, o 2.<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><blockquote class="notion-quote whitespace-pre-wrap break-words w-full border-solid border-l-4 pl-4 border-current 59d172f40c6c465281cc8c23c9d19081">Si metemos 1 🡪 Ha ganado el equipo local
Si metemos X 🡪 Ha sido empate
Si metemos 2 🡪 Ha ganado el equipo visitante
Otra cosa 🡪 Opción no válida<!-- --></blockquote><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl">
#<span class="token operator">!</span><span class="token operator">/</span>bin<span class="token operator">/</span>bash
#Ejercicio <span class="token keyword">case</span> <span class="token operator">-</span> en caso de<span class="token operator">...</span>
echo <span class="token operator">-</span>n <span class="token string">"Escribe el resultado del partido:"</span><span class="token punctuation">;</span> read res
<span class="token keyword">case</span> $res <span class="token keyword">in</span>
<span class="token number">1</span><span class="token punctuation">)</span> echo <span class="token string">"Gana el equipo local 🎉🎉"</span><span class="token punctuation">;</span><span class="token punctuation">;</span>
<span class="token constant">X</span><span class="token punctuation">)</span> echo <span class="token string">"Empate.."</span><span class="token punctuation">;</span><span class="token punctuation">;</span>
<span class="token number">2</span><span class="token punctuation">)</span> echo <span class="token string">"Ha ganado el equipo visitante🥲🥲"</span><span class="token punctuation">;</span><span class="token punctuation">;</span>
<span class="token operator">*</span><span class="token punctuation">)</span> echo <span class="token string">"Opcion no valida.."</span> <span class="token operator">&&</span> echo <span class="token string">"Se ejetuta el script.."</span> <span class="token operator">&&</span> source <span class="token number">6.</span>sh<span class="token punctuation">;</span><span class="token punctuation">;</span>
esac</code></pre></div></div></div><div style="background-color:var(--notion-gray_background)" class="notion-callout border flex space-x-3 p-4 rounded-md 27907c921ef0445a95b0c4d7ff3ee647"><span class="notion-page-icon m-2 mt-0 h-5 w-5 " role="img" aria-label="🐧">🐧</span><div class="break-words whitespace-pre-wrap notion-callout-text min-w-0"><b class="font-bold text-gray-700 dark:text-gray-100">Escript con AND, OR, NOT<!-- --></b><div class="notion-text w-full whitespace-pre-wrap break-words f3ec763afcd346d48d3d041e6915415a">Los comandos AND, OR y NOT son expresiones lógicas que se utilizan con IF, WHILE..<!-- --><div class="flex flex-col notion-text-children "><div class="notion-text w-full whitespace-pre-wrap break-words ef70438f7f9a46988b66e76da026ac2f">EXPRESIONES LOGICAS:
AND 🡪 && ó –a 🡪 <!-- --><span style="background-color:var(--notion-teal_background)">Verdadero<!-- --></span> si <!-- --><span class="underline">ambas<!-- --></span> expresiones son ciertas.
OR 🡪 || ó -o 🡪 <!-- --><span style="background-color:var(--notion-teal_background)">Verdadero<!-- --></span> si <!-- --><span class="underline">una<!-- --></span> de las expresiones es cierta.
NOT 🡪 !expresión 🡪 <!-- --><span style="background-color:var(--notion-teal_background)">Verdadero<!-- --></span> si la expresión <!-- --><span class="underline">no<!-- --></span> es cierta.<!-- --></div></div></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><b class="font-bold text-gray-700 dark:text-gray-100">Ejercicio 7: <!-- --></b>Notas y Faltas.<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><blockquote class="notion-quote whitespace-pre-wrap break-words w-full border-solid border-l-4 pl-4 border-current 8790c7b6b6d648b3aca751fda23addf9">Crea un script que diga que:
Estás suspenso si tienes menos de 5 en nota o más de 10 faltas.
Estas aprobado si tienes más de 5 y además tienes menos de 10 faltas.<!-- --></blockquote><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#Ejercicio condicion doble
echo <span class="token operator">-</span>n <span class="token string">"Introduce tu nota: "</span><span class="token punctuation">;</span> read nota
echo <span class="token operator">-</span>n <span class="token string">"Introduce tus faltas: "</span><span class="token punctuation">;</span> read faltas
<span class="token keyword">if</span> <span class="token punctuation">[</span> $nota <span class="token operator">-</span>ge <span class="token number">5</span> <span class="token punctuation">]</span> <span class="token operator">&&</span> <span class="token punctuation">[</span> $faltas <span class="token operator">-</span>lt <span class="token number">10</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> then
echo <span class="token string">"APROBADO 😁"</span>
fi
<span class="token keyword">if</span> <span class="token punctuation">[</span> $nota <span class="token operator">-</span>lt <span class="token number">5</span> <span class="token punctuation">]</span> <span class="token operator">||</span> <span class="token punctuation">[</span> $faltas <span class="token operator">-</span>ge <span class="token number">10</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> then
echo <span class="token string">"SUSPENSO 😔"</span>
fi</code></pre></div><div class="notion-blank h-4 4f3f1526c6fc4f2fa2cf102b8841bea6"></div></div></div><div style="background-color:var(--notion-gray_background)" class="notion-callout border flex space-x-3 p-4 rounded-md 15a7230e3fb942eea3afb54860344af3"><span class="notion-page-icon m-2 mt-0 h-5 w-5 " role="img" aria-label="🐧">🐧</span><div class="break-words whitespace-pre-wrap notion-callout-text min-w-0"><b class="font-bold text-gray-700 dark:text-gray-100">SCRIPT CON WHILE (BUCLE)<!-- --></b><div class="notion-text w-full whitespace-pre-wrap break-words 3b5e4440fcdf43ec9b0b87f818dcfc4c">Para crear bucles en scripts, utilizaremos WHILE. (mientras...)<!-- --><div class="flex flex-col notion-text-children "><div class="notion-text w-full whitespace-pre-wrap break-words 75f87238854d4dd29de3fb6bab114f5f">Estuctura:<!-- --><div class="flex flex-col notion-text-children "><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token keyword">while</span> <span class="token punctuation">[</span> <span class="token constant">CONDICIONAL</span> <span class="token punctuation">]</span>
<span class="token keyword">do</span>
Se ejecuta este campo hasta que la condicional sea <span class="token constant">FALSE</span><span class="token punctuation">.</span>
done</code></pre></div></div></div></div></div><div class="notion-blank h-4 d705cfc3f22d43f4abc9c8d26f1aa80c"></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><b class="font-bold text-gray-700 dark:text-gray-100">Ejercicio 8: <!-- --></b>Crea un script y mete números en pantalla hasta que meter el 0 que el bucle finalizará<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#Ejercicio bucle
echo <span class="token operator">-</span>n <span class="token string">"Introduce un numero: "</span><span class="token punctuation">;</span> read num
<span class="token keyword">while</span> <span class="token punctuation">[</span> $num <span class="token operator">-</span>ne <span class="token number">0</span> <span class="token punctuation">]</span>
<span class="token keyword">do</span>
echo <span class="token string">"⛔ Numero incorrecto ⛔"</span> <span class="token operator">&&</span> echo <span class="token operator">-</span>n <span class="token string">"Repitelo: "</span><span class="token punctuation">;</span> read num
done
echo <span class="token string">"Numero correcto 🎉"</span></code></pre></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><b class="font-bold text-gray-700 dark:text-gray-100">Ejercicio 9<!-- --></b>: Crea un script en el que metas una contraseña y si no se cumple que la vuelva a pedir, si la metes bien el bucle finaliza.<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#ejercicio para casa bucle
echo <span class="token operator">-</span>n <span class="token string">"Introduce la password: "</span><span class="token punctuation">;</span> read pass
int<span class="token operator">=</span><span class="token number">1</span>
<span class="token keyword">while</span> <span class="token punctuation">[</span> $pass <span class="token operator">!=</span> <span class="token string">"hola"</span> <span class="token punctuation">]</span>
<span class="token keyword">do</span>
echo <span class="token operator">-</span>n <span class="token string">"⛔ Vuelva a introducir la contrasena: "</span><span class="token punctuation">;</span> read pass
done
echo <span class="token string">"La contraseña es correcta 🎉"</span></code></pre></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><span style="background-color:var(--notion-blue_background)"><b class="font-bold text-gray-700 dark:text-gray-100">EXTRA:<!-- --></b></span><b class="font-bold text-gray-700 dark:text-gray-100"> <!-- --></b>Crea un script en el que metas una contraseña y si no correcta que la vuelva a pedir, como máximo puede ponerla 3 veces, si no que ponga que estás bloqueado.<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#ejercicio para casa bucle
echo <span class="token operator">-</span>n <span class="token string">"Introduce la password: "</span><span class="token punctuation">;</span> read pass
int<span class="token operator">=</span><span class="token number">1</span>
<span class="token keyword">while</span> <span class="token punctuation">[</span> $pass <span class="token operator">!=</span> <span class="token string">"hola"</span> <span class="token punctuation">]</span> <span class="token operator">&&</span> <span class="token punctuation">[</span> $int <span class="token operator">-</span>lt <span class="token number">3</span> <span class="token punctuation">]</span>
<span class="token keyword">do</span>
echo <span class="token operator">-</span>n <span class="token string">"Vuelva a introducir la contrasena: "</span><span class="token punctuation">;</span>read pass
int<span class="token operator">=</span>$<span class="token punctuation">[</span>$int <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">]</span>
done
<span class="token keyword">if</span> <span class="token punctuation">[</span> $pass <span class="token operator">=</span> <span class="token string">"hola"</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> then
echo <span class="token string">"La contraseña es correcta 🎉"</span>
<span class="token keyword">else</span>
echo <span class="token string">"⛔ La cuenta ha sido bloqueada ⛔"</span>
fi</code></pre></div></div></div><div style="background-color:var(--notion-gray_background)" class="notion-callout border flex space-x-3 p-4 rounded-md 73c39925091d4d53b66d21682e032402"><span class="notion-page-icon m-2 mt-0 h-5 w-5 " role="img" aria-label="🐧">🐧</span><div class="break-words whitespace-pre-wrap notion-callout-text min-w-0">SCRIPT CON FOR (BUCLE UN NÚMERO DE VECES)<!-- --><div class="notion-text w-full whitespace-pre-wrap break-words 3c40e62bff624f6aa5fbca28d6fc67ab">Para crear un bucle un número de veces específico utilizamos FOR. La estructura de FOR es:<!-- --><div class="flex flex-col notion-text-children "><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token keyword">for</span> num <span class="token keyword">in</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">seq 1 100</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">;</span>
<span class="token keyword">do</span>
Aquí escribimos lo que hará durante <span class="token number">100</span> <span class="token function">veces</span> <span class="token punctuation">(</span>cada vez num tiene un valor superior al anterior<span class="token punctuation">)</span>
done</code></pre></div></div></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><b class="font-bold text-gray-700 dark:text-gray-100">Ejercicio 10<!-- --></b>: Crea un script que haga la suma de los 100 primeros números.<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#ejercicio sumar los <span class="token number">100</span> primeros numeros
<span class="token keyword">for</span> num <span class="token keyword">in</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">seq 1 100</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">;</span>
<span class="token keyword">do</span>
suma<span class="token operator">=</span>$<span class="token punctuation">[</span>$suma <span class="token operator">+</span> $num<span class="token punctuation">]</span>
echo $suma
done</code></pre></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><b class="font-bold text-gray-700 dark:text-gray-100">Ejercicio 11<!-- --></b>: Crea un script que te pida la edad, si eres mayor de 18 y menor de 67 puedes trabajar.<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#ejercicio edad
echo <span class="token operator">-</span>n <span class="token string">"Introduzca su edad: "</span><span class="token punctuation">;</span> read edad
<span class="token keyword">if</span> <span class="token punctuation">[</span> $edad <span class="token operator">-</span>ge <span class="token number">18</span> <span class="token punctuation">]</span> <span class="token operator">&&</span> <span class="token punctuation">[</span> $edad <span class="token operator">-</span>le <span class="token number">67</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> then
echo <span class="token string">"Puedes trabajar"</span>
<span class="token keyword">else</span>
echo <span class="token string">"No puedes trabajar"</span>
fi</code></pre></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><b class="font-bold text-gray-700 dark:text-gray-100">Ejercicio 12<!-- --></b>: Crea un script que te pida la edad, si eres mayor de 18 y menor de 67 puedes trabajar.<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#ejercicio sumar nums
echo <span class="token operator">-</span>n <span class="token string">"Introduzca un numero: "</span><span class="token punctuation">;</span>read num
suma<span class="token operator">=</span>$num
<span class="token keyword">while</span> <span class="token punctuation">[</span> $num <span class="token operator">-</span>ne <span class="token number">0</span> <span class="token punctuation">]</span>
<span class="token keyword">do</span>
echo <span class="token operator">-</span>n <span class="token string">"Introduce otro numero: "</span><span class="token punctuation">;</span>read num
suma<span class="token operator">=</span>$<span class="token punctuation">[</span>$suma <span class="token operator">+</span> $num<span class="token punctuation">]</span>
done
echo <span class="token string">"La suma es $suma"</span></code></pre></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><b class="font-bold text-gray-700 dark:text-gray-100">Ejercicio 13<!-- --></b>: Crea un script que partiendo del número 100, se vayan introduciendo números hasta que la resta de los números llegue al 0.<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#ejercicio resta
rest<span class="token operator">=</span><span class="token number">100</span>
<span class="token keyword">while</span> <span class="token punctuation">[</span> $rest <span class="token operator">-</span>gt <span class="token number">0</span> <span class="token punctuation">]</span>
<span class="token keyword">do</span>
echo <span class="token string">"Tienes $rest."</span> <span class="token operator">&&</span> echo <span class="token operator">-</span>n <span class="token string">"Introduce un numero para restra: "</span><span class="token punctuation">;</span> read num
rest<span class="token operator">=</span>$<span class="token punctuation">[</span>$rest <span class="token operator">-</span> $num<span class="token punctuation">]</span>
done
echo <span class="token string">"La resta ya ha llegado a 0"</span></code></pre></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><b class="font-bold text-gray-700 dark:text-gray-100">Ejercicio 14<!-- --></b>: Crea un script que muestre por pantalla los números pares hasta el 1000.<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#ejercicio escribir números pares hasta el <span class="token number">1000</span>
<span class="token keyword">for</span> num <span class="token keyword">in</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">seq 1 500</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">;</span>
<span class="token keyword">do</span>
par<span class="token operator">=</span>$<span class="token punctuation">[</span>$num <span class="token operator">*</span> <span class="token number">2</span><span class="token punctuation">]</span>
echo $par
done</code></pre></div></div></div><div style="background-color:var(--notion-gray_background)" class="notion-callout border flex space-x-3 p-4 rounded-md 5fa7a9c856f2450297059d4ef022025c"><span class="notion-page-icon m-2 mt-0 h-5 w-5 " role="img" aria-label="🐧">🐧</span><div class="break-words whitespace-pre-wrap notion-callout-text min-w-0">SCRIPT CON PARAMETROS<!-- --><div class="notion-text w-full whitespace-pre-wrap break-words 89039fc723784c97a994e865276c54d0">Los parámetros sirven para introducir los datos cuando ejecutas el script, es decir, sin pedirlos por pantalla.<!-- --><div class="flex flex-col notion-text-children "><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#ejercicio <span class="token function">parametros</span> <span class="token punctuation">(</span>puedo introducir datos ejecutando el script<span class="token punctuation">)</span>
media<span class="token operator">=</span><span class="token number">0</span>
media<span class="token operator">=</span>$<span class="token punctuation">[</span> <span class="token punctuation">(</span> $<span class="token number">1</span> <span class="token operator">+</span> $<span class="token number">2</span> <span class="token operator">+</span> $<span class="token number">3</span> <span class="token punctuation">)</span><span class="token operator">/</span><span class="token number">3</span> <span class="token punctuation">]</span>
echo <span class="token string">"La media es de $media."</span></code></pre></div><div class="notion-text w-full whitespace-pre-wrap break-words b9dc1452b73a4fc189b2bb87a612578d">Para ejecutarlo pondríamos: <!-- --><span style="background-color:var(--notion-teal_background)">./parámetro.sh 10 5 3<!-- --></span> o source ff.sh 8 7 9<!-- --></div></div></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><b class="font-bold text-gray-700 dark:text-gray-100">Ejercicio 15<!-- --></b>: Crea un script que aparezca por pantalla el número de asteriscos que tu introduzcas con parámetros.<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#ejercicio asteriscos que tu introduzcas con parámetros
<span class="token keyword">for</span> num <span class="token keyword">in</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">seq 1 $1</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">;</span>
<span class="token keyword">do</span>
echo <span class="token string">"*"</span>
done</code></pre></div><div class="notion-blank h-4 8cd6eb98d5004aec896cdb3259e2b5bd"></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><b class="font-bold text-gray-700 dark:text-gray-100">Ejercicio 16<!-- --></b>: Crea un script mediante parámetros, que cree el número de carpetas que indicamos con el nombre carpeta_nº.<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#ejercicio crear carpeta
<span class="token keyword">for</span> num <span class="token keyword">in</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">seq 1 $1</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">;</span>
<span class="token keyword">do</span>
mkdir Carpeta_del_usuario$num
done
ls</code></pre></div><div class="notion-blank h-4 2ffddf9e0e2545fdbffde384e33c9194"></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><b class="font-bold text-gray-700 dark:text-gray-100">Ejercicio 17<!-- --></b>: CUENTALINEAS: Crea un script con parámetros que devuelva las líneas que tiene el archivo indicado como parámetro.<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#ejercicio cuentalineas wc <span class="token operator">-</span>l
wc <span class="token operator">-</span>l $<span class="token number">1</span></code></pre></div><div class="notion-blank h-4 adb8bad678314b4e9155613aff52dfed"></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><span style="background-color:var(--notion-blue_background)"><b class="font-bold text-gray-700 dark:text-gray-100">EXTRA:<!-- --></b></span> Modifica el script anterior para cambiar el mensaje cuando NO exista el fichero.<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#ejercicio cuentalineas wc <span class="token operator">-</span>l
<span class="token keyword">if</span> <span class="token punctuation">[</span> <span class="token operator">!</span> <span class="token operator">-</span>e $<span class="token number">1</span> <span class="token punctuation">]</span><span class="token punctuation">;</span>
then
echo <span class="token string">"El fichero $1 no existe"</span>
<span class="token keyword">else</span>
echo <span class="token string">"El archivo $1 tiene "</span>
wc <span class="token operator">-</span>l $<span class="token number">1</span>
fi</code></pre></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><b class="font-bold text-gray-700 dark:text-gray-100">Ejercicio 18<!-- --></b>: Crea un script<!-- --><b class="font-bold text-gray-700 dark:text-gray-100"> <!-- --></b>que te pida un usuario para ver los procesos de ese usuario y los muestre. Después que pida el PID para matar el proceso.<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#ejercicio matar proceso
echo <span class="token operator">-</span>n <span class="token string">"Introduce el usuario del que deseas ver los procesos: "</span><span class="token punctuation">;</span>read user
sudo ps <span class="token operator">-</span>fea $user
echo <span class="token operator">-</span>n <span class="token string">"Introduce el PID del proceso para matarlo: "</span><span class="token punctuation">;</span>read pid
kill $pid
echo <span class="token string">"Proceso detenido"</span></code></pre></div><div class="notion-blank h-4 e803da3bff6a4d2f9c846b7690bd7858"></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><span style="background-color:var(--notion-blue_background)"><b class="font-bold text-gray-700 dark:text-gray-100">EXTRA:<!-- --></b></span> Modifica el script anterior para<!-- --><b class="font-bold text-gray-700 dark:text-gray-100"> <!-- --></b>que busque solo los procesos de Firefox.<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#ejercicio matar proceso
ps <span class="token operator">-</span>fea <span class="token operator">|</span> grep <span class="token string">"firefox"</span>
echo <span class="token operator">-</span>n <span class="token string">"Introduce el PID del proceso para matarlo: "</span><span class="token punctuation">;</span> read pid
kill $pid
echo <span class="token string">"Proceso detenido."</span></code></pre></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><b class="font-bold text-gray-700 dark:text-gray-100">Ejercicio 19:<!-- --></b> Crea un script que cree el número de usuarios que nosotros digamos<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#crear usuarios
echo <span class="token operator">-</span>n <span class="token string">"¿Cuantos usuarios quieres crear? "</span><span class="token punctuation">;</span> read num
<span class="token keyword">for</span> usu <span class="token keyword">in</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">seq 1 $num</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">;</span>
<span class="token keyword">do</span>
sudo useradd <span class="token operator">-</span>d <span class="token operator">/</span>home<span class="token operator">/</span>user<span class="token operator">-</span>$usu User<span class="token operator">-</span>$usu
done</code></pre></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><span style="background-color:var(--notion-blue_background)"><b class="font-bold text-gray-700 dark:text-gray-100">EXTRA:<!-- --></b></span> Modifica el script anterior para pasar el número de usuarios nuevos por parámetro.<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
#crear usuarios
<span class="token keyword">for</span> usu <span class="token keyword">in</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">seq 1 $1</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">;</span>
<span class="token keyword">do</span>
sudo useradd <span class="token operator">-</span>d <span class="token operator">/</span>home<span class="token operator">/</span>user<span class="token operator">-</span>$usu User<span class="token operator">-</span>$usu
done</code></pre></div></div></div><div class="space-y-2"><div class="flex items-center space-x-3 font-semibold outline-none cursor-pointer"><svg viewBox="0 0 8 8" fill="currentColor" xmlns="https://www.w3.org/2000/svg" class="self-start flex-shrink-0 w-2 h-2 my-2 opacity-80"><path d="M0 0.724246C0 0.111374 0.681914 -0.223425 1.13107 0.168926L4.66916 3.25957C5.11028 3.6449 5.11028 4.3551 4.66916 4.74043L1.13107 7.83107C0.681913 8.22342 0 7.88863 0 7.27575V0.724246Z" fill="currentColor"></path></svg><div class="whitespace-pre-wrap"><b class="font-bold text-gray-700 dark:text-gray-100">Ejercicio 20:<!-- --></b> Crea un script como una Calculadora<!-- --></div></div><div class="hidden ml-5 space-y-4 min-w-0"><blockquote class="notion-quote whitespace-pre-wrap break-words w-full border-solid border-l-4 pl-4 border-current 31f8ece132224ba5ae4d121f711cf8db">1- sumar
2- restar
3- multiplicar
4- dividir
5- salir<!-- --></blockquote><div class="relative"><pre style="font-size:14px" class="text-gray-100 px-8 py-8 my-6 overflow-x-auto !bg-gray-800 !border-transparent rounded-md focus:outline-none"><div class="absolute flex items-center space-x-2 font-mono text-xs text-white top-2 right-4 opacity-60"><span class="">bash</span><svg xmlns="https://www.w3.org/2000/svg" class="w-4 h-4 cursor-pointer fill-current" viewBox="0 0 20 20" fill="currentColor"><path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"></path><path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"></path></svg></div><code style="text-shadow:none !important" class="font-medium max-w-screen-2xl"><span class="token hashbang comment">#!/bin/bash</span>
num<span class="token operator">=</span><span class="token number">1</span>
<span class="token keyword">while</span> <span class="token punctuation">[</span> $num <span class="token operator">-</span>ne <span class="token number">5</span> <span class="token punctuation">]</span>
<span class="token keyword">do</span>
echo <span class="token string">"Opciones:"</span> <span class="token operator">&&</span> echo <span class="token string">"1. Sumar"</span> <span class="token operator">&&</span> echo <span class="token string">"2. Restar"</span> <span class="token operator">&&</span> echo <span class="token string">"3. Multiplicar"</span> <span class="token operator">&&</span> echo <span class="token string">"4. Dividir"</span> <span class="token operator">&&</span> echo <span class="token string">"5. Salir"</span>
echo <span class="token operator">-</span>n <span class="token string">"¿Que quieres hacer? "</span><span class="token punctuation">;</span> read num
<span class="token keyword">if</span> <span class="token punctuation">[</span> $num <span class="token operator">-</span>eq <span class="token number">1</span> <span class="token punctuation">]</span><span class="token punctuation">;</span>
then
clear
echo <span class="token operator">-</span>n <span class="token string">"Introduce el número: "</span><span class="token punctuation">;</span> read suma1
echo <span class="token operator">-</span>n <span class="token string">"Introduce el número que quieras Sumar: "</span><span class="token punctuation">;</span> read suma2
suma<span class="token operator">=</span>$<span class="token punctuation">[</span>$suma1 <span class="token operator">+</span> $suma2<span class="token punctuation">]</span>
echo <span class="token string">"El resultado de la Suma es de $suma."</span>
echo <span class="token string">"------------------------------------------------------"</span>
fi
<span class="token keyword">if</span> <span class="token punctuation">[</span> $num <span class="token operator">-</span>eq <span class="token number">2</span> <span class="token punctuation">]</span><span class="token punctuation">;</span>
then
clear
echo <span class="token operator">-</span>n <span class="token string">"Introduce el número: "</span><span class="token punctuation">;</span> read resta1
echo <span class="token operator">-</span>n <span class="token string">"Introduce el número que quieras Restar: "</span><span class="token punctuation">;</span> read resta2
resta<span class="token operator">=</span>$<span class="token punctuation">[</span>$resta1 <span class="token operator">-</span> $resta2<span class="token punctuation">]</span>
echo <span class="token string">"El resultado de la Resta es de $resta."</span>
echo <span class="token string">"------------------------------------------------------"</span>
fi
<span class="token keyword">if</span> <span class="token punctuation">[</span> $num <span class="token operator">-</span>eq <span class="token number">3</span> <span class="token punctuation">]</span><span class="token punctuation">;</span>
then
clear
echo <span class="token string">"Introduce el primer número: "</span><span class="token punctuation">;</span> read mul1
echo <span class="token string">"Introduce el número por cual quieres Multiplicar: "</span><span class="token punctuation">;</span> read mul2
mul<span class="token operator">=</span>$<span class="token punctuation">[</span>$mul1 <span class="token operator">*</span> $mul2<span class="token punctuation">]</span>
echo <span class="token string">"El resultado de la Multiplicación es de $mul."</span>
echo <span class="token string">"------------------------------------------------------"</span>
fi
<span class="token keyword">if</span> <span class="token punctuation">[</span> $num <span class="token operator">-</span>eq <span class="token number">4</span> <span class="token punctuation">]</span><span class="token punctuation">;</span>
then
clear
echo <span class="token operator">-</span>n <span class="token string">"Introduce el número: "</span><span class="token punctuation">;</span> read div1
echo <span class="token operator">-</span>n <span class="token string">"Introduce el número por cual vas a Dividir: "</span><span class="token punctuation">;</span> read div2
res<span class="token operator">=</span>$<span class="token punctuation">[</span>$div1 <span class="token operator">%</span> $div2<span class="token punctuation">]</span>
div<span class="token operator">=</span>$<span class="token punctuation">[</span>$div1 <span class="token operator">/</span> $div2<span class="token punctuation">]</span>
echo <span class="token string">"El resultado es $div y el resto es $res"</span>
echo <span class="token string">"------------------------------------------------------"</span>
fi
<span class="token keyword">if</span> <span class="token punctuation">[</span> $num <span class="token operator">-</span>gt <span class="token number">5</span> <span class="token punctuation">]</span><span class="token punctuation">;</span>
then
clear
echo <span class="token string">"Operacion no valida. Introduzca un número del 1 al 5"</span>
echo <span class="token string">"------------------------------------------------------"</span>
fi
done
echo <span class="token string">"FIN.."</span></code></pre></div></div></div><div></div></main><div class="flex-auto h-8"></div><div class="flex flex-col space-y-8"><div class="flex lg:flex-row items-center justify-between py-2 w-full "><div class="flex-auto"></div><div class="flex-auto w-3"></div><div class="flex-auto"></div></div><hr class="border-t"><div class="flex items-end space-x-0 "><div class="flex-auto"><div class="hidden text-xs tracking-wide xl:text-sm lg:block opacity-60 ">Last updated<!-- --> <!-- -->11 days ago<!-- --></div></div><div class="text-xs font-semibold tracking-wider text-right uppercase opacity-60">Was this page helpful?</div><div class="feedback origin-bottom-right" style="transform:scale(0.8)"><svg xmlns="https://www.w3.org/2000/svg" style="display:none"><symbol xmlns="https://www.w3.org/2000/svg" viewBox="0 0 7 4" id="eye"><path d="M1,1 C1.83333333,2.16666667 2.66666667,2.75 3.5,2.75 C4.33333333,2.75 5.16666667,2.16666667 6,1"></path></symbol><symbol xmlns="https://www.w3.org/2000/svg" viewBox="0 0 18 7" id="mouth"><path d="M1,5.5 C3.66666667,2.5 6.33333333,1 9,1 C11.6666667,1 14.3333333,2.5 17,5.5"></path></symbol></svg><label class="ok"><input autocomplete="off" type="radio" name="feedback" value="0"><div></div></label><label class="good"><input type="radio" autocomplete="off" name="feedback" value="1"><div><svg class="eye left"><use xlink:href="#eye"></use></svg><svg class="eye right"><use xlink:href="#eye"></use></svg><svg class="mouth"><use xlink:href="#mouth"></use></svg></div></label><label class="happy"><input type="radio" autocomplete="off" name="feedback" value="2"><div><svg class="eye left"><use xlink:href="#eye"></use></svg><svg class="eye right"><use xlink:href="#eye"></use></svg></div></label></div></div><div></div></div></div><div class=""></div></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"siteId":"cl2jt6gm1003809jp0iycj7ta","passwordProtected":false,"lastUpdated":1651198800000,"host":"iso_3t.notaku.site","rootPageId":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","recordMap":{"block":{"3e8e1fa2-d7e1-441c-975f-dc4f43470b23":{"value":{"id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","type":"page","properties":{"title":[["3º Trimestre"]]},"content":["fe441d34-714b-4c77-9deb-5116b6307ab5","2d64215b-554d-440c-8af1-7204763398ab","39a98247-5cc1-4bc2-b27a-1467de7615aa","f3ab3153-b348-435c-bad3-3e9886f6704b","ba67929a-08d4-4c26-9eab-99fe712398a5","6a7caa6f-2476-4172-a4c1-033a0ec03f70","5d0c21ee-ceb7-42d1-8d9d-8e57230d84b9","714dd689-e6a4-4d5b-8b22-8a023d30e50d","b301c2cb-0460-4ef5-a1f2-75e109af3491","08cfe0d1-52ca-4b4a-8444-68a89434a655","36b51db9-0c8b-4410-bfcb-40b35d972c45","5b1ec966-0bf9-4974-b2e2-d403274591c0","8a68a652-dd26-48c6-9bce-b1ec4108f7d1","0e056eeb-10a7-4746-b9de-b0f6499df394","1b40cfc8-f783-4922-a2b5-b266d6f07639","a2c9888b-6135-4632-8f17-c56ecdde6eee","cf3891e4-a0ef-4247-bc8c-955e1bd4aeac","e835791b-7dfd-41d9-8810-2d0ee3133b83","55da18f1-d638-4f3b-a034-12e9ce6582a4","a3c17035-12b3-4360-a699-5abe1105cc64","27907c92-1ef0-445a-95b0-c4d7ff3ee647","631212ec-4521-4db1-94a4-1c40512ba0c7","15a7230e-3fb9-42ee-a3af-b54860344af3","4d7d3419-c796-4967-97a9-565fd2b316d0","4f43a11e-0bae-4c85-a6fe-94cdd35360ee","58b7bae2-ba57-45bb-bf65-f234918ba160","73c39925-091d-4d53-b66d-21682e032402","6cadbe16-a8e5-46d4-8cfa-dfeb9ffd93a3","97f36687-34bf-4499-87a4-875a50983c61","a6ee37df-1534-4d59-a9bf-ef1e2aba0a18","08195686-54cc-4bf6-b060-b2ac83746458","20642607-35ed-4919-9aa5-bd953c4df0d4","5fa7a9c8-56f2-4502-9705-9d4ef022025c","07662e59-3400-4618-b02c-17bb32a91288","5a2195ba-f783-4a67-b0e0-e20143d3e341","da7a8b9a-0a31-42a4-a396-32de84419513","a04f6391-5c77-470a-84c3-b300b1cff150","320cf3f1-37f2-4c70-b82b-260149bab611","f13726ae-503b-4ba3-9a44-8b9f6d8d1feb","e5685e06-3afa-4ed0-8e27-d49235dce9db","8796c2f7-2cd3-4d2e-969a-92c9154decc0","9f805d8e-58dc-48de-95d7-680aa586e6fa","ae9418f7-610b-4b10-8879-f8b922dd48f8"],"format":{"page_font":"mono","page_icon":"https://blog.toright.com/wp-content/uploads/2019/05/bash.png","page_cover":"https://images.unsplash.com/photo-1508830524289-0adcbe822b40?ixlib=rb-1.2.1\u0026q=85\u0026fm=jpg\u0026crop=entropy\u0026cs=srgb","block_locked":true,"block_locked_by":"ffa63290-e940-4136-96a7-0606f1a8f203","page_full_width":true,"page_small_text":true,"page_cover_position":0.5},"created_time":1650915247217,"last_edited_time":1651198800000,"parent_id":"8b0072df-5a04-4cc5-b374-93c1e3e7e885","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"fe441d34-714b-4c77-9deb-5116b6307ab5":{"value":{"id":"fe441d34-714b-4c77-9deb-5116b6307ab5","type":"callout","properties":{"title":[["COMANDOS DE PROCESOS Y FILTROS",[["b"]]]]},"content":["46c83e96-6f75-4a5e-b891-ab9db033d7e2"],"format":{"page_icon":"🔍","block_color":"gray_background"},"created_time":1651195151934,"last_edited_time":1651198620000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"46c83e96-6f75-4a5e-b891-ab9db033d7e2":{"value":{"id":"46c83e96-6f75-4a5e-b891-ab9db033d7e2","type":"text","properties":{"title":[["Para ver los procesos que se están ejecutando en Ubuntu utilizamos el comando "],["ps -fea\n",[["b"],["h","teal_background"]]],["Para parar un proceso se utiliza el comando"],[" ",[["b"]]],["kill PID",[["b"],["h","teal_background"]]],[" ",[["b"]]],["(identificador del proceso)\nPara forzar su detención se usa el comando:"]]},"content":["83b631f3-5383-41d4-acbe-2ddec647b5f9"],"created_time":1651195187129,"last_edited_time":1651198620000,"parent_id":"fe441d34-714b-4c77-9deb-5116b6307ab5","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"83b631f3-5383-41d4-acbe-2ddec647b5f9":{"value":{"id":"83b631f3-5383-41d4-acbe-2ddec647b5f9","type":"text","properties":{"title":[["kill -9 PID",[["b"],["h","teal_background"]]]]},"created_time":1651195130351,"last_edited_time":1651198620000,"parent_id":"46c83e96-6f75-4a5e-b891-ab9db033d7e2","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"2d64215b-554d-440c-8af1-7204763398ab":{"value":{"id":"2d64215b-554d-440c-8af1-7204763398ab","type":"callout","properties":{"title":[["REDIRECCIONAMIENTO",[["b"]]]]},"content":["dd9c414b-0ab9-431e-92dd-48854a3767fb"],"format":{"page_icon":"📥","block_color":"gray_background"},"created_time":1651195224977,"last_edited_time":1651196100000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"dd9c414b-0ab9-431e-92dd-48854a3767fb":{"value":{"id":"dd9c414b-0ab9-431e-92dd-48854a3767fb","type":"text","properties":{"title":[["Para redireccionar la salida de la información, utilizamos "],["\u003e",[["h","teal_background"]]],["\nNos cambiará nuestra salida de información a un archivo de texto, por ejemplo. \nCon "],["\u003e",[["h","teal_background"]]],[" la información que haya en el archivo se "],["SOBREESCRIBE",[["h","red_background"]]],[".\nCon "],["\u003e\u003e",[["h","teal_background"]]],[" la información se sigue escribiendo al final del archivo."]]},"format":{},"created_time":1651195224978,"last_edited_time":1651198560000,"parent_id":"2d64215b-554d-440c-8af1-7204763398ab","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"39a98247-5cc1-4bc2-b27a-1467de7615aa":{"value":{"id":"39a98247-5cc1-4bc2-b27a-1467de7615aa","type":"callout","properties":{"title":[["OTROS COMANDOS",[["b"]]]]},"content":["236617ec-a861-42aa-b42a-5ea3121137a8","d9e5b5e6-d05f-466e-8528-0c9683d20268"],"format":{"page_icon":"🌐","block_color":"gray_background"},"created_time":1651195430348,"last_edited_time":1651196940000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"236617ec-a861-42aa-b42a-5ea3121137a8":{"value":{"id":"236617ec-a861-42aa-b42a-5ea3121137a8","type":"text","properties":{"title":[["WGET"]]},"created_time":1651196940000,"last_edited_time":1651196940000,"parent_id":"39a98247-5cc1-4bc2-b27a-1467de7615aa","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"d9e5b5e6-d05f-466e-8528-0c9683d20268":{"value":{"id":"d9e5b5e6-d05f-466e-8528-0c9683d20268","type":"text","properties":{"title":[["Ejercicio:",[["b"]]],["\nEjecuta un comando para mostrar los 10 primeros músicos de la lista de los 40 Principales.\n"],["Wget https://los40.com/lista40/",[["h","teal_background"]]]]},"content":["c668e5d0-f294-4539-a6df-56601925ba0d"],"created_time":1651196886086,"last_edited_time":1651198620000,"parent_id":"39a98247-5cc1-4bc2-b27a-1467de7615aa","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"c668e5d0-f294-4539-a6df-56601925ba0d":{"value":{"id":"c668e5d0-f294-4539-a6df-56601925ba0d","type":"text","properties":{"title":[["Grep nombre_artista index.html | cut -d “ “ -f 7 | head",[["h","teal_background"]]]]},"format":{},"created_time":1651196928517,"last_edited_time":1651196940000,"parent_id":"d9e5b5e6-d05f-466e-8528-0c9683d20268","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"f3ab3153-b348-435c-bad3-3e9886f6704b":{"value":{"id":"f3ab3153-b348-435c-bad3-3e9886f6704b","type":"callout","properties":{"title":[["SCRIPTS",[["b"]]]]},"content":["7518ca62-4647-4a39-8e9a-d1f37cdb13c6"],"format":{"page_icon":"📌","block_color":"gray_background"},"created_time":1651195707163,"last_edited_time":1651196940000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"7518ca62-4647-4a39-8e9a-d1f37cdb13c6":{"value":{"id":"7518ca62-4647-4a39-8e9a-d1f37cdb13c6","type":"text","properties":{"title":[["Los scripts son un programa simple, que generalmente se crean en un archivo de texto."]]},"content":["b43e5998-1d34-4aeb-949e-6586dea80830","4446e904-5173-4ada-b2e7-502b74912c86"],"created_time":1651196968251,"last_edited_time":1651198620000,"parent_id":"f3ab3153-b348-435c-bad3-3e9886f6704b","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"b43e5998-1d34-4aeb-949e-6586dea80830":{"value":{"id":"b43e5998-1d34-4aeb-949e-6586dea80830","type":"text","properties":{"title":[["Para que los scripts funcionen se debe poner en su primera línea:"]]},"created_time":1651195731442,"last_edited_time":1651196940000,"parent_id":"7518ca62-4647-4a39-8e9a-d1f37cdb13c6","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"4446e904-5173-4ada-b2e7-502b74912c86":{"value":{"id":"4446e904-5173-4ada-b2e7-502b74912c86","type":"quote","properties":{"title":[["#!/bin/bash",[["b"]]]]},"created_time":1651195740088,"last_edited_time":1651197000000,"parent_id":"7518ca62-4647-4a39-8e9a-d1f37cdb13c6","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"ba67929a-08d4-4c26-9eab-99fe712398a5":{"value":{"id":"ba67929a-08d4-4c26-9eab-99fe712398a5","type":"callout","properties":{"title":[["SCRIPT CON ECHO",[["b"]]]]},"content":["add082ab-c4ed-4735-b642-e4f8e1198f34"],"format":{"page_icon":"🖥️","block_color":"gray_background"},"created_time":1651195782085,"last_edited_time":1651198680000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"add082ab-c4ed-4735-b642-e4f8e1198f34":{"value":{"id":"add082ab-c4ed-4735-b642-e4f8e1198f34","type":"text","properties":{"title":[["El comando "],["echo",[["h","orange"],["b"]]],[" nos sacará por pantalla la información que introduzcamos entre comillas"]]},"content":["e1a5cba0-fc64-42b3-bb04-12953f4c8bd5","120968dc-1ed1-4f60-9f52-d865924b6887","84faf8e3-7ed0-4ea7-8731-11aea6821556"],"created_time":1651197030791,"last_edited_time":1651198680000,"parent_id":"ba67929a-08d4-4c26-9eab-99fe712398a5","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"e1a5cba0-fc64-42b3-bb04-12953f4c8bd5":{"value":{"id":"e1a5cba0-fc64-42b3-bb04-12953f4c8bd5","type":"text","properties":{"title":[["Ejemplo: Script saludando"]]},"format":{},"created_time":1651197041757,"last_edited_time":1651197000000,"parent_id":"add082ab-c4ed-4735-b642-e4f8e1198f34","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"120968dc-1ed1-4f60-9f52-d865924b6887":{"value":{"id":"120968dc-1ed1-4f60-9f52-d865924b6887","type":"code","properties":{"title":[["#!/bin/bash\n#Linea que sera ignorada\necho \"Hola\"\necho \"Soy un script\"\necho \"salu2\""]],"language":[["Bash"]]},"format":{},"created_time":1651197041757,"last_edited_time":1651197000000,"parent_id":"add082ab-c4ed-4735-b642-e4f8e1198f34","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"84faf8e3-7ed0-4ea7-8731-11aea6821556":{"value":{"id":"84faf8e3-7ed0-4ea7-8731-11aea6821556","type":"text","properties":{"title":[["Hay que darle permisos de ejecución.\nPara ejecutarlo: "],["./saludos.sh",[["h","teal_background"]]],[" o "],["source saludos.sh",[["h","teal_background"]]],[" sin Permisos."]]},"format":{},"created_time":1651197041757,"last_edited_time":1651198680000,"parent_id":"add082ab-c4ed-4735-b642-e4f8e1198f34","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"6a7caa6f-2476-4172-a4c1-033a0ec03f70":{"value":{"id":"6a7caa6f-2476-4172-a4c1-033a0ec03f70","type":"callout","properties":{"title":[["SCRIPT CON VARIABLES (I)",[["b"]]]]},"content":["6d2db5cc-63d9-4bbe-a796-a901f78d6f85","34a81a44-300e-4a98-8d8d-a07f7d232285","16c01d87-aa9a-4b72-8953-256e3e4fc348","b2e61edb-45c9-44d0-8d6d-217e0bd91a9f","070c7d4c-7e2c-4247-95e6-616072f94f5f"],"format":{"page_icon":"📦","block_color":"gray_background"},"created_time":1651196028973,"last_edited_time":1651197120000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"6d2db5cc-63d9-4bbe-a796-a901f78d6f85":{"value":{"id":"6d2db5cc-63d9-4bbe-a796-a901f78d6f85","type":"text","properties":{"title":[["Las variables nos guardan el valor en una caja, puede ser de texto o número. Para crear una variable, tenemos que escribir "],["nombrevariable=valor",[["b"]]],[" (kilos=80)"]]},"content":["0b56cea7-4e6e-41ce-ac45-ab9b5eecc051","07174bbc-dd2d-4779-a951-f88d630c6c32"],"created_time":1651197067358,"last_edited_time":1651198680000,"parent_id":"6a7caa6f-2476-4172-a4c1-033a0ec03f70","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"0b56cea7-4e6e-41ce-ac45-ab9b5eecc051":{"value":{"id":"0b56cea7-4e6e-41ce-ac45-ab9b5eecc051","type":"text","properties":{"title":[["Para hacer referencia a una variable tenemos que escribirla con el símbolo $ delante. ("],["$nombre",[["b"],["h","purple"]]],[")",[["b"]]]]},"format":{},"created_time":1651197081519,"last_edited_time":1651197060000,"parent_id":"6d2db5cc-63d9-4bbe-a796-a901f78d6f85","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"07174bbc-dd2d-4779-a951-f88d630c6c32":{"value":{"id":"07174bbc-dd2d-4779-a951-f88d630c6c32","type":"code","properties":{"title":[["#!/bin/bash\n#Ejercicio 1 de las variables\nnombre=Evelyn\nedad=18\nestatura=1.60\necho \"Hola me llamo $nombre , tengo $edad años y mido $estatura\""]],"language":[["Bash"]]},"format":{},"created_time":1651197091508,"last_edited_time":1651197180000,"parent_id":"6d2db5cc-63d9-4bbe-a796-a901f78d6f85","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"34a81a44-300e-4a98-8d8d-a07f7d232285":{"value":{"id":"34a81a44-300e-4a98-8d8d-a07f7d232285","type":"text","properties":{"title":[["SCRIPT CON VARIABLES (II)",[["b"]]]]},"created_time":1651196221991,"last_edited_time":1651197120000,"parent_id":"6a7caa6f-2476-4172-a4c1-033a0ec03f70","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"16c01d87-aa9a-4b72-8953-256e3e4fc348":{"value":{"id":"16c01d87-aa9a-4b72-8953-256e3e4fc348","type":"text","properties":{"title":[["Para hacer operaciones con variables, debemos de crear una variable de esta manera:"]]},"content":["b3b68912-b01c-4dfd-b5ce-8f04be59689e","f4e4db0c-4c1e-4330-bafc-22a16a02e489","98b20842-9a87-46aa-acb4-3978dc5f6967"],"created_time":1651197112021,"last_edited_time":1651198680000,"parent_id":"6a7caa6f-2476-4172-a4c1-033a0ec03f70","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"b3b68912-b01c-4dfd-b5ce-8f04be59689e":{"value":{"id":"b3b68912-b01c-4dfd-b5ce-8f04be59689e","type":"quote","properties":{"title":[["suma=$[$num1 + $num2]",[["b"],["h","blue"]]]]},"format":{},"created_time":1651197123466,"last_edited_time":1651197120000,"parent_id":"16c01d87-aa9a-4b72-8953-256e3e4fc348","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"f4e4db0c-4c1e-4330-bafc-22a16a02e489":{"value":{"id":"f4e4db0c-4c1e-4330-bafc-22a16a02e489","type":"text","properties":{"title":[["Ejemplo: suma de datos en una variable."]]},"format":{},"created_time":1651197123466,"last_edited_time":1651197120000,"parent_id":"16c01d87-aa9a-4b72-8953-256e3e4fc348","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"98b20842-9a87-46aa-acb4-3978dc5f6967":{"value":{"id":"98b20842-9a87-46aa-acb4-3978dc5f6967","type":"code","properties":{"title":[["#!/bin/bash\n#ejercicio variables 2\ndato1=5\ndato2=2\nsuma=$[$dato1+$dato2]\necho \"El resultado de sumar $dato1 y $dato2 es $suma\""]],"language":[["Bash"]]},"format":{},"created_time":1651197134296,"last_edited_time":1651197120000,"parent_id":"16c01d87-aa9a-4b72-8953-256e3e4fc348","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"b2e61edb-45c9-44d0-8d6d-217e0bd91a9f":{"value":{"id":"b2e61edb-45c9-44d0-8d6d-217e0bd91a9f","type":"text","properties":{"title":[["SCRIPT CON VARIABLES (III)",[["b"]]]]},"created_time":1651196221993,"last_edited_time":1651197120000,"parent_id":"6a7caa6f-2476-4172-a4c1-033a0ec03f70","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"070c7d4c-7e2c-4247-95e6-616072f94f5f":{"value":{"id":"070c7d4c-7e2c-4247-95e6-616072f94f5f","type":"text","properties":{"title":[["Para realizar diferentes operaciones, debemos de escribir lo mismo pero con el signo correspondiente:"]]},"content":["791b46e9-ba1c-4e1c-bedc-0c84b13a3350","9376ad24-b6ab-4a1c-a2a9-fae404d6ed88"],"created_time":1651197151274,"last_edited_time":1651198680000,"parent_id":"6a7caa6f-2476-4172-a4c1-033a0ec03f70","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"791b46e9-ba1c-4e1c-bedc-0c84b13a3350":{"value":{"id":"791b46e9-ba1c-4e1c-bedc-0c84b13a3350","type":"text","properties":{"title":[["resta=$[$num1 - $num2]\ndivision=$[$num1 / $num2]\nmultiplicacion=$[$num1 * $num2]\ncociente=$[$num1 % $num2]",[["b"],["h","blue"]]]]},"created_time":1651196421655,"last_edited_time":1651198800000,"parent_id":"070c7d4c-7e2c-4247-95e6-616072f94f5f","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"9376ad24-b6ab-4a1c-a2a9-fae404d6ed88":{"value":{"id":"9376ad24-b6ab-4a1c-a2a9-fae404d6ed88","type":"text","properties":{"title":[["Ejemplo: realizando varias operaciones en variables."]]},"content":["52d5ba47-d9ed-4b41-a352-66aeef185c1b"],"created_time":1651196221993,"last_edited_time":1651197180000,"parent_id":"070c7d4c-7e2c-4247-95e6-616072f94f5f","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"52d5ba47-d9ed-4b41-a352-66aeef185c1b":{"value":{"id":"52d5ba47-d9ed-4b41-a352-66aeef185c1b","type":"code","properties":{"title":[["#!/bin/bash\n#Ejercicio 3 de variables\ndato1=5\ndato2=2\nsuma=$[$dato1 + $dato2]\nresta=$[$dato1 - $dato2]\nmultiplicacion=$[$dato1 * $dato2]\ndivision=$[$dato1 / $dato2]\necho \"El resultado de la suma de $dato1 y $dato2 es $suma\"\necho \"El resultado de la resta de $dato1 y $dato2 es $resta\"\necho \"El resultado de la multiplicacion de $dato1 y $dato2 es $multiplicacion\"\necho \"El resultado de la division de $dato1 y $dato2 es $division\""]],"language":[["Bash"]]},"created_time":1651196474786,"last_edited_time":1651196460000,"parent_id":"9376ad24-b6ab-4a1c-a2a9-fae404d6ed88","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"5d0c21ee-ceb7-42d1-8d9d-8e57230d84b9":{"value":{"id":"5d0c21ee-ceb7-42d1-8d9d-8e57230d84b9","type":"callout","properties":{"title":[["SCRIPT CON READ (INTRODUCIENDO VALORES)",[["b"]]]]},"content":["9224b086-05be-4fa5-83c5-3504c97f8773"],"format":{"page_icon":"📝","block_color":"gray_background"},"created_time":1651196570002,"last_edited_time":1651197240000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"9224b086-05be-4fa5-83c5-3504c97f8773":{"value":{"id":"9224b086-05be-4fa5-83c5-3504c97f8773","type":"text","properties":{"title":[["Para que nuestro script pida unos datos al usuario, debemos de crear cajas con el comando "],["read",[["b"],["h","orange"]]],[". ",[["b"]]],["Solo tenemos que crear la caja escribiendo"],[" ",[["b"]]],["read ",[["b"],["h","orange"]]],["nombre",[["b"],["i"],["h","orange"]]],[". ",[["b"],["i"]]],["Para hacer referencia a la caja, también escribiremos "],["$nombre",[["b"],["i"],["h","purple"]]]]},"content":["22918ff1-01a7-443d-8c00-dd231b9c16c8","d8df3094-54e8-4ad7-a73d-89d49111db66"],"created_time":1651197221047,"last_edited_time":1651198740000,"parent_id":"5d0c21ee-ceb7-42d1-8d9d-8e57230d84b9","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"22918ff1-01a7-443d-8c00-dd231b9c16c8":{"value":{"id":"22918ff1-01a7-443d-8c00-dd231b9c16c8","type":"text","properties":{"title":[["Ejemplo: pide tu nombre, y lo repite."]]},"created_time":1651196582645,"last_edited_time":1651197240000,"parent_id":"9224b086-05be-4fa5-83c5-3504c97f8773","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"d8df3094-54e8-4ad7-a73d-89d49111db66":{"value":{"id":"d8df3094-54e8-4ad7-a73d-89d49111db66","type":"code","properties":{"title":[["#!/bin/bash\n#ejercicio 4 de variables introduciendo valores\necho \"Escribe tu nombre\"\nread nombre\necho \"Hola soy $nombre\""]],"language":[["Bash"]]},"created_time":1651196868667,"last_edited_time":1651197240000,"parent_id":"9224b086-05be-4fa5-83c5-3504c97f8773","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"714dd689-e6a4-4d5b-8b22-8a023d30e50d":{"value":{"id":"714dd689-e6a4-4d5b-8b22-8a023d30e50d","type":"toggle","properties":{"title":[["Ejercicio 1",[["b"]]],[": Crea un script que calcule tu edad introduciendo tu año de nacimiento y tu nombre."]]},"content":["8b17fc57-34b1-427e-8327-ab64fa4e9797"],"created_time":1650915240000,"last_edited_time":1651196520000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"b301c2cb-0460-4ef5-a1f2-75e109af3491":{"value":{"id":"b301c2cb-0460-4ef5-a1f2-75e109af3491","type":"toggle","properties":{"title":[["Ejercicio 2",[["b"]]],[": Crea un script que muestre en el fichero resultado.txt la fecha del sistema y el nombre de los usuarios de nuestro equipo."]]},"content":["287742cd-a8a5-450b-8180-ed284e6068e5"],"created_time":1650987284768,"last_edited_time":1651185480000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"08cfe0d1-52ca-4b4a-8444-68a89434a655":{"value":{"id":"08cfe0d1-52ca-4b4a-8444-68a89434a655","type":"toggle","properties":{"title":[["Ejercicio 3",[["b"]]],[": Crea un script que muestre en un archivo de texto los procesos que ejecuta un usuario en concreto, en este caso, el usuario ubuntu."]]},"content":["3dccf129-5209-42f7-9374-6480063150aa"],"created_time":1650987284769,"last_edited_time":1651185480000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"36b51db9-0c8b-4410-bfcb-40b35d972c45":{"value":{"id":"36b51db9-0c8b-4410-bfcb-40b35d972c45","type":"toggle","properties":{"title":[["Ejercicio 4",[["b"]]],[": Modifica el script anterior para que sirva para cualquier usuario."]]},"content":["3b02a92d-67fe-41f7-80e8-f98aec0082cf"],"created_time":1650987284769,"last_edited_time":1651185480000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"5b1ec966-0bf9-4974-b2e2-d403274591c0":{"value":{"id":"5b1ec966-0bf9-4974-b2e2-d403274591c0","type":"divider","created_time":1650997556210,"last_edited_time":1650998460000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"8a68a652-dd26-48c6-9bce-b1ec4108f7d1":{"value":{"id":"8a68a652-dd26-48c6-9bce-b1ec4108f7d1","type":"callout","properties":{"title":[["SCRIPT CON IF Y ELSE",[["b"]]]]},"content":["dcf8c595-0ac1-4ba7-9851-669025ee2a30"],"format":{"page_icon":"🐧","block_color":"gray_background"},"created_time":1651186303898,"last_edited_time":1651197240000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"dcf8c595-0ac1-4ba7-9851-669025ee2a30":{"value":{"id":"dcf8c595-0ac1-4ba7-9851-669025ee2a30","type":"text","properties":{"title":[["Estuctura:"]]},"content":["41cb84d8-84a3-43d6-afb7-7d7b3a835110","35cefa64-6fe5-4789-b708-3789f0ee546c","a4d8a28c-626f-4ffb-86b9-85ba57015143"],"created_time":1651197265699,"last_edited_time":1651198740000,"parent_id":"8a68a652-dd26-48c6-9bce-b1ec4108f7d1","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"41cb84d8-84a3-43d6-afb7-7d7b3a835110":{"value":{"id":"41cb84d8-84a3-43d6-afb7-7d7b3a835110","type":"code","properties":{"title":[["if [ "],["CONDICIONAL",[["b"],["h","purple_background"]]],[" ]; \nthen #Si es "],["true",[["h","teal_background"]]],["\nelif "],["#Para otra condicional",[["b"]]],["\nelse #Si es "],["false",[["h","red_background"]]],["\nfi #FIN"]],"language":[["Bash"]]},"created_time":1651000044426,"last_edited_time":1651197240000,"parent_id":"dcf8c595-0ac1-4ba7-9851-669025ee2a30","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"35cefa64-6fe5-4789-b708-3789f0ee546c":{"value":{"id":"35cefa64-6fe5-4789-b708-3789f0ee546c","type":"sub_sub_header","properties":{"title":[["Expresiones Condicionales"]]},"created_time":1650998628047,"last_edited_time":1651197240000,"parent_id":"dcf8c595-0ac1-4ba7-9851-669025ee2a30","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"a4d8a28c-626f-4ffb-86b9-85ba57015143":{"value":{"id":"a4d8a28c-626f-4ffb-86b9-85ba57015143","type":"table","content":["17987969-b09e-4a68-bd1e-864c1921c7d0","7d24d723-8aba-42e0-acb3-8cf2de10a4a5","4922d75e-a38b-4558-810f-3a5d15156a03","1209a04a-5c7b-4375-8565-363b641c9d2c","532db2ea-4639-46b7-86da-2dc4c89664f5","ed54e4bd-f769-488f-9554-2e7d901a8e4c","1cdb47c1-2e10-4882-8462-50271c37f08c"],"format":{"table_block_column_order":["]odz","qhkj","kWO\u003c"],"table_block_column_format":{"]odz":{"width":228},"kWO\u003c":{"width":228},"qhkj":{"width":228}},"table_block_column_header":true},"created_time":1650997637249,"last_edited_time":1651197240000,"parent_id":"dcf8c595-0ac1-4ba7-9851-669025ee2a30","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"17987969-b09e-4a68-bd1e-864c1921c7d0":{"value":{"id":"17987969-b09e-4a68-bd1e-864c1921c7d0","type":"table_row","properties":{"]odz":[["Sirve"]],"kWO\u003c":[["Letras"]],"qhkj":[["Numeros"]]},"created_time":1650997637249,"last_edited_time":1650997620000,"parent_id":"a4d8a28c-626f-4ffb-86b9-85ba57015143","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"7d24d723-8aba-42e0-acb3-8cf2de10a4a5":{"value":{"id":"7d24d723-8aba-42e0-acb3-8cf2de10a4a5","type":"table_row","properties":{"]odz":[["true",[["h","teal_background"]]],[" si es ="]],"kWO\u003c":[["="]],"qhkj":[["-eq"]]},"created_time":1650997637249,"last_edited_time":1650999540000,"parent_id":"a4d8a28c-626f-4ffb-86b9-85ba57015143","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"4922d75e-a38b-4558-810f-3a5d15156a03":{"value":{"id":"4922d75e-a38b-4558-810f-3a5d15156a03","type":"table_row","properties":{"]odz":[["true",[["h","teal_background"]]],[" si es ≠"]],"kWO\u003c":[["≠"]],"qhkj":[["-ne"]]},"created_time":1650997637249,"last_edited_time":1650999540000,"parent_id":"a4d8a28c-626f-4ffb-86b9-85ba57015143","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"1209a04a-5c7b-4375-8565-363b641c9d2c":{"value":{"id":"1209a04a-5c7b-4375-8565-363b641c9d2c","type":"table_row","properties":{"]odz":[["true",[["h","teal_background"]]],[" si es \u003c"]],"qhkj":[["-lt"]]},"created_time":1650997680000,"last_edited_time":1650999540000,"parent_id":"a4d8a28c-626f-4ffb-86b9-85ba57015143","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"532db2ea-4639-46b7-86da-2dc4c89664f5":{"value":{"id":"532db2ea-4639-46b7-86da-2dc4c89664f5","type":"table_row","properties":{"]odz":[["true",[["h","teal_background"]]],[" si es \u003e"]],"qhkj":[["-gt"]]},"created_time":1650997680000,"last_edited_time":1650999540000,"parent_id":"a4d8a28c-626f-4ffb-86b9-85ba57015143","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"ed54e4bd-f769-488f-9554-2e7d901a8e4c":{"value":{"id":"ed54e4bd-f769-488f-9554-2e7d901a8e4c","type":"table_row","properties":{"]odz":[["true",[["h","teal_background"]]],[" si es ≤"]],"qhkj":[["-le"]]},"created_time":1650997680000,"last_edited_time":1650999540000,"parent_id":"a4d8a28c-626f-4ffb-86b9-85ba57015143","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"1cdb47c1-2e10-4882-8462-50271c37f08c":{"value":{"id":"1cdb47c1-2e10-4882-8462-50271c37f08c","type":"table_row","properties":{"]odz":[["true",[["h","teal_background"]]],[" si es ≥"]],"qhkj":[["-ge"]]},"created_time":1650997680000,"last_edited_time":1650999480000,"parent_id":"a4d8a28c-626f-4ffb-86b9-85ba57015143","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"0e056eeb-10a7-4746-b9de-b0f6499df394":{"value":{"id":"0e056eeb-10a7-4746-b9de-b0f6499df394","type":"toggle","properties":{"title":[["Mayor y Menor de EDAD"]]},"content":["d6ee1a10-abfa-427d-881b-b6172f07ba17"],"created_time":1650998340000,"last_edited_time":1650998580000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"1b40cfc8-f783-4922-a2b5-b266d6f07639":{"value":{"id":"1b40cfc8-f783-4922-a2b5-b266d6f07639","type":"toggle","properties":{"title":[["Contraseña"]]},"content":["1660398b-a1d0-440f-9dea-68a4cfed5869"],"created_time":1650998280000,"last_edited_time":1651183620000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"a2c9888b-6135-4632-8f17-c56ecdde6eee":{"value":{"id":"a2c9888b-6135-4632-8f17-c56ecdde6eee","type":"divider","created_time":1650998507224,"last_edited_time":1650998460000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"cf3891e4-a0ef-4247-bc8c-955e1bd4aeac":{"value":{"id":"cf3891e4-a0ef-4247-bc8c-955e1bd4aeac","type":"toggle","properties":{"title":[["Ejercicio 5",[["b"]]],[": Crea un script sumando 3 notas (0 al 10), divídelas entre 3 y si el resultado es mayor de 5, que te devuelva un mensaje diciendo que estás aprobado y si no; suspenso."]]},"content":["e91eb24c-002a-4ab3-8767-bf1aac3d7738"],"created_time":1650998580000,"last_edited_time":1651185480000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"e835791b-7dfd-41d9-8810-2d0ee3133b83":{"value":{"id":"e835791b-7dfd-41d9-8810-2d0ee3133b83","type":"toggle","properties":{"title":[["EXTRA:",[["b"],["h","blue_background"]]],[" Si el usuario es root tiene todos los permisos, si es un usuari tiene los permisos de ese usiario y si es otro no tiene ningun permiso."]]},"content":["cf8655bb-89d9-43a8-b16c-b5123e84e0c1"],"created_time":1651000711357,"last_edited_time":1651188720000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"55da18f1-d638-4f3b-a034-12e9ce6582a4":{"value":{"id":"55da18f1-d638-4f3b-a034-12e9ce6582a4","type":"callout","properties":{"title":[["SCRIPT CON CASE",[["b"]]]]},"content":["248e3cfe-4528-48e7-bd7e-cbd2a048c65a"],"format":{"page_icon":"🐧","block_color":"gray_background"},"created_time":1651186042535,"last_edited_time":1651197240000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"248e3cfe-4528-48e7-bd7e-cbd2a048c65a":{"value":{"id":"248e3cfe-4528-48e7-bd7e-cbd2a048c65a","type":"text","properties":{"title":[["Estuctura:"]]},"content":["4b1db529-bd1f-4ad5-b20c-61b51466ac61"],"created_time":1651197289541,"last_edited_time":1651198740000,"parent_id":"55da18f1-d638-4f3b-a034-12e9ce6582a4","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"4b1db529-bd1f-4ad5-b20c-61b51466ac61":{"value":{"id":"4b1db529-bd1f-4ad5-b20c-61b51466ac61","type":"code","properties":{"title":[["case $num in\n1) aquí escribimos lo que queremos que haga si pulsamos 1. ;;\n2) aquí escribimos lo que queremos que haga si pulsamos 1. ;;\n*) aquí escribimos lo que queremos que haga si pulsamos cualquier otra tecla. ; exit ;;\nesac"]],"language":[["Bash"]]},"format":{},"created_time":1651185895811,"last_edited_time":1651197240000,"parent_id":"248e3cfe-4528-48e7-bd7e-cbd2a048c65a","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"a3c17035-12b3-4360-a699-5abe1105cc64":{"value":{"id":"a3c17035-12b3-4360-a699-5abe1105cc64","type":"toggle","properties":{"title":[["Ejercicio 6",[["b"]]],[": Crear script de QUINIELA. Podemos meter 1, X, o 2."]]},"content":["59d172f4-0c6c-4652-81cc-8c23c9d19081","c4674f59-0141-467b-aa78-5f77e3e9f62d"],"created_time":1651183758723,"last_edited_time":1651185480000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"27907c92-1ef0-445a-95b0-c4d7ff3ee647":{"value":{"id":"27907c92-1ef0-445a-95b0-c4d7ff3ee647","type":"callout","properties":{"title":[["Escript con AND, OR, NOT",[["b"]]]]},"content":["f3ec763a-fcd3-46d4-8d3d-041e6915415a"],"format":{"page_icon":"🐧","block_color":"gray_background"},"created_time":1651186263498,"last_edited_time":1651197300000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"f3ec763a-fcd3-46d4-8d3d-041e6915415a":{"value":{"id":"f3ec763a-fcd3-46d4-8d3d-041e6915415a","type":"text","properties":{"title":[["Los comandos AND, OR y NOT son expresiones lógicas que se utilizan con IF, WHILE.."]]},"content":["ef70438f-7f9a-4698-8b66-e76da026ac2f"],"created_time":1651197304501,"last_edited_time":1651198740000,"parent_id":"27907c92-1ef0-445a-95b0-c4d7ff3ee647","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"ef70438f-7f9a-4698-8b66-e76da026ac2f":{"value":{"id":"ef70438f-7f9a-4698-8b66-e76da026ac2f","type":"text","properties":{"title":[["EXPRESIONES LOGICAS:\nAND 🡪 \u0026\u0026 ó –a 🡪 "],["Verdadero",[["h","teal_background"]]],[" si "],["ambas",[["_"]]],[" expresiones son ciertas.\nOR 🡪 || ó -o 🡪 "],["Verdadero",[["h","teal_background"]]],[" si "],["una",[["_"]]],[" de las expresiones es cierta.\nNOT 🡪 !expresión 🡪 "],["Verdadero",[["h","teal_background"]]],[" si la expresión "],["no",[["_"]]],[" es cierta."]]},"created_time":1651184908945,"last_edited_time":1651198740000,"parent_id":"f3ec763a-fcd3-46d4-8d3d-041e6915415a","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"631212ec-4521-4db1-94a4-1c40512ba0c7":{"value":{"id":"631212ec-4521-4db1-94a4-1c40512ba0c7","type":"toggle","properties":{"title":[["Ejercicio 7: ",[["b"]]],["Notas y Faltas."]]},"content":["8790c7b6-b6d6-48b3-aca7-51fda23addf9","88c63e66-bc17-49af-bf68-c1cef75ecfe0","4f3f1526-c6fc-4f2f-a2cf-102b8841bea6"],"created_time":1651185139997,"last_edited_time":1651188120000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"15a7230e-3fb9-42ee-a3af-b54860344af3":{"value":{"id":"15a7230e-3fb9-42ee-a3af-b54860344af3","type":"callout","properties":{"title":[["SCRIPT CON WHILE (BUCLE)",[["b"]]]]},"content":["3b5e4440-fcdf-43ec-9b0b-87f818dcfc4c","d705cfc3-f22d-43f4-abc9-c8d26f1aa80c"],"format":{"page_icon":"🐧","block_color":"gray_background"},"created_time":1651186217260,"last_edited_time":1651197300000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"3b5e4440-fcdf-43ec-9b0b-87f818dcfc4c":{"value":{"id":"3b5e4440-fcdf-43ec-9b0b-87f818dcfc4c","type":"text","properties":{"title":[["Para crear bucles en scripts, utilizaremos WHILE. (mientras...)"]]},"content":["75f87238-854d-4dd2-9de3-fb6bab114f5f"],"created_time":1651197319782,"last_edited_time":1651198740000,"parent_id":"15a7230e-3fb9-42ee-a3af-b54860344af3","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"75f87238-854d-4dd2-9de3-fb6bab114f5f":{"value":{"id":"75f87238-854d-4dd2-9de3-fb6bab114f5f","type":"text","properties":{"title":[["Estuctura:"]]},"content":["47e9ffde-13b2-4bc1-83e4-e1609e5c78d8"],"created_time":1651187220000,"last_edited_time":1651197300000,"parent_id":"3b5e4440-fcdf-43ec-9b0b-87f818dcfc4c","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"47e9ffde-13b2-4bc1-83e4-e1609e5c78d8":{"value":{"id":"47e9ffde-13b2-4bc1-83e4-e1609e5c78d8","type":"code","properties":{"title":[["while [ "],["CONDICIONAL",[["b"],["h","purple_background"]]],[" ]\ndo\n\tSe ejecuta este campo hasta que la condicional sea "],["FALSE",[["h","red_background"]]],[".\ndone"]],"language":[["Bash"]]},"created_time":1651187231718,"last_edited_time":1651188420000,"parent_id":"75f87238-854d-4dd2-9de3-fb6bab114f5f","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"d705cfc3-f22d-43f4-abc9-c8d26f1aa80c":{"value":{"id":"d705cfc3-f22d-43f4-abc9-c8d26f1aa80c","type":"text","format":{},"created_time":1651185677917,"last_edited_time":1651187100000,"parent_id":"15a7230e-3fb9-42ee-a3af-b54860344af3","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"4d7d3419-c796-4967-97a9-565fd2b316d0":{"value":{"id":"4d7d3419-c796-4967-97a9-565fd2b316d0","type":"toggle","properties":{"title":[["Ejercicio 8: ",[["b"]]],["Crea un script y mete números en pantalla hasta que meter el 0 que el bucle finalizará"]]},"content":["da12336d-7415-423b-920a-a03e280e5d26"],"created_time":1651185620116,"last_edited_time":1651187340000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"4f43a11e-0bae-4c85-a6fe-94cdd35360ee":{"value":{"id":"4f43a11e-0bae-4c85-a6fe-94cdd35360ee","type":"toggle","properties":{"title":[["Ejercicio 9",[["b"]]],[": Crea un script en el que metas una contraseña y si no se cumple que la vuelva a pedir, si la metes bien el bucle finaliza."]]},"content":["6a8e577d-8016-4252-8dc3-a687cd7150a9"],"created_time":1651188132994,"last_edited_time":1651188120000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"58b7bae2-ba57-45bb-bf65-f234918ba160":{"value":{"id":"58b7bae2-ba57-45bb-bf65-f234918ba160","type":"toggle","properties":{"title":[["EXTRA:",[["b"],["h","blue_background"]]],[" ",[["b"]]],["Crea un script en el que metas una contraseña y si no correcta que la vuelva a pedir, como máximo puede ponerla 3 veces, si no que ponga que estás bloqueado."]]},"content":["f44375bb-421c-48be-b3d6-680bd0ae13a9"],"created_time":1651188420000,"last_edited_time":1651188720000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"73c39925-091d-4d53-b66d-21682e032402":{"value":{"id":"73c39925-091d-4d53-b66d-21682e032402","type":"callout","properties":{"title":[["SCRIPT CON FOR (BUCLE UN NÚMERO DE VECES)"]]},"content":["3c40e62b-ff62-4f6a-a5fb-ca28d6fc67ab"],"format":{"page_icon":"🐧","block_color":"gray_background"},"created_time":1651188786772,"last_edited_time":1651197300000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"3c40e62b-ff62-4f6a-a5fb-ca28d6fc67ab":{"value":{"id":"3c40e62b-ff62-4f6a-a5fb-ca28d6fc67ab","type":"text","properties":{"title":[["Para crear un bucle un número de veces específico utilizamos FOR. La estructura de FOR es:"]]},"content":["24344c0a-b9e2-46d6-aa59-54f1bb54ad9e"],"created_time":1651197348212,"last_edited_time":1651198740000,"parent_id":"73c39925-091d-4d53-b66d-21682e032402","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"24344c0a-b9e2-46d6-aa59-54f1bb54ad9e":{"value":{"id":"24344c0a-b9e2-46d6-aa59-54f1bb54ad9e","type":"code","properties":{"title":[["for "],["num",[["h","pink_background"]]],[" in `seq 1 100`;\ndo\n\tAquí escribimos lo que hará durante 100 veces (cada vez "],["num",[["h","pink_background"]]],[" tiene un valor superior al anterior)\ndone"]],"language":[["Bash"]]},"format":{},"created_time":1651188786773,"last_edited_time":1651197300000,"parent_id":"3c40e62b-ff62-4f6a-a5fb-ca28d6fc67ab","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"6cadbe16-a8e5-46d4-8cfa-dfeb9ffd93a3":{"value":{"id":"6cadbe16-a8e5-46d4-8cfa-dfeb9ffd93a3","type":"toggle","properties":{"title":[["Ejercicio 10",[["b"]]],[": Crea un script que haga la suma de los 100 primeros números."]]},"content":["d2723ba5-8b12-4d6e-83a7-d66f024b98b8"],"created_time":1651188990880,"last_edited_time":1651190700000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"97f36687-34bf-4499-87a4-875a50983c61":{"value":{"id":"97f36687-34bf-4499-87a4-875a50983c61","type":"toggle","properties":{"title":[["Ejercicio 11",[["b"]]],[": Crea un script que te pida la edad, si eres mayor de 18 y menor de 67 puedes trabajar."]]},"content":["8613a876-f850-4735-b397-46b9184a7b7e"],"format":{},"created_time":1651189154555,"last_edited_time":1651189140000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"a6ee37df-1534-4d59-a9bf-ef1e2aba0a18":{"value":{"id":"a6ee37df-1534-4d59-a9bf-ef1e2aba0a18","type":"toggle","properties":{"title":[["Ejercicio 12",[["b"]]],[": Crea un script que te pida la edad, si eres mayor de 18 y menor de 67 puedes trabajar."]]},"content":["35399939-30db-452b-bff9-2ef70e25f7fa"],"format":{},"created_time":1651189276177,"last_edited_time":1651189260000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"08195686-54cc-4bf6-b060-b2ac83746458":{"value":{"id":"08195686-54cc-4bf6-b060-b2ac83746458","type":"toggle","properties":{"title":[["Ejercicio 13",[["b"]]],[": Crea un script que partiendo del número 100, se vayan introduciendo números hasta que la resta de los números llegue al 0."]]},"content":["8da90e8b-96c2-4b3a-a741-4ed8ee469113"],"format":{},"created_time":1651189450704,"last_edited_time":1651190220000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"20642607-35ed-4919-9aa5-bd953c4df0d4":{"value":{"id":"20642607-35ed-4919-9aa5-bd953c4df0d4","type":"toggle","properties":{"title":[["Ejercicio 14",[["b"]]],[": Crea un script que muestre por pantalla los números pares hasta el 1000."]]},"content":["9a282164-d43b-4995-a30a-c49e7839e11b"],"format":{},"created_time":1651190212181,"last_edited_time":1651190220000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"5fa7a9c8-56f2-4502-9705-9d4ef022025c":{"value":{"id":"5fa7a9c8-56f2-4502-9705-9d4ef022025c","type":"callout","properties":{"title":[["SCRIPT CON PARAMETROS"]]},"content":["89039fc7-2378-4c97-a994-e865276c54d0"],"format":{"page_icon":"🐧","block_color":"gray_background"},"created_time":1651190366962,"last_edited_time":1651197360000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"89039fc7-2378-4c97-a994-e865276c54d0":{"value":{"id":"89039fc7-2378-4c97-a994-e865276c54d0","type":"text","properties":{"title":[["Los parámetros sirven para introducir los datos cuando ejecutas el script, es decir, sin pedirlos por pantalla."]]},"content":["9f7ac3fe-2552-476f-8fbb-bcdcc5edbd92","b9dc1452-b73a-4fc1-89b2-bb87a612578d"],"created_time":1651197364506,"last_edited_time":1651198740000,"parent_id":"5fa7a9c8-56f2-4502-9705-9d4ef022025c","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"9f7ac3fe-2552-476f-8fbb-bcdcc5edbd92":{"value":{"id":"9f7ac3fe-2552-476f-8fbb-bcdcc5edbd92","type":"code","properties":{"title":[["#!/bin/bash\n#ejercicio parametros (puedo introducir datos ejecutando el script)\nmedia=0\nmedia=$[ ( $1 + $2 + $3 )/3 ]\necho \"La media es de $media.\""]],"language":[["Bash"]]},"format":{},"created_time":1651190366963,"last_edited_time":1651197360000,"parent_id":"89039fc7-2378-4c97-a994-e865276c54d0","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"b9dc1452-b73a-4fc1-89b2-bb87a612578d":{"value":{"id":"b9dc1452-b73a-4fc1-89b2-bb87a612578d","type":"text","properties":{"title":[["Para ejecutarlo pondríamos: "],["./parámetro.sh 10 5 3",[["h","teal_background"]]],[" o source ff.sh 8 7 9"]]},"created_time":1651190340000,"last_edited_time":1651197360000,"parent_id":"89039fc7-2378-4c97-a994-e865276c54d0","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"07662e59-3400-4618-b02c-17bb32a91288":{"value":{"id":"07662e59-3400-4618-b02c-17bb32a91288","type":"toggle","properties":{"title":[["Ejercicio 15",[["b"]]],[": Crea un script que aparezca por pantalla el número de asteriscos que tu introduzcas con parámetros."]]},"content":["0af0de52-9308-46bf-9b06-f51276984f64","8cd6eb98-d500-4aec-896c-db3259e2b5bd"],"format":{},"created_time":1651190702529,"last_edited_time":1651190940000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"5a2195ba-f783-4a67-b0e0-e20143d3e341":{"value":{"id":"5a2195ba-f783-4a67-b0e0-e20143d3e341","type":"toggle","properties":{"title":[["Ejercicio 16",[["b"]]],[": Crea un script mediante parámetros, que cree el número de carpetas que indicamos con el nombre carpeta_nº."]]},"content":["116abb61-bdaf-4730-b7a9-731c880c2ba3","2ffddf9e-0e25-45fd-bffd-e384e33c9194"],"format":{},"created_time":1651190995379,"last_edited_time":1651191000000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"da7a8b9a-0a31-42a4-a396-32de84419513":{"value":{"id":"da7a8b9a-0a31-42a4-a396-32de84419513","type":"toggle","properties":{"title":[["Ejercicio 17",[["b"]]],[": CUENTALINEAS: Crea un script con parámetros que devuelva las líneas que tiene el archivo indicado como parámetro."]]},"content":["c352edb0-203e-4a24-b466-fb07e03b8c5b","adb8bad6-7831-4b4e-9155-613aff52dfed"],"format":{},"created_time":1651191267980,"last_edited_time":1651191240000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"a04f6391-5c77-470a-84c3-b300b1cff150":{"value":{"id":"a04f6391-5c77-470a-84c3-b300b1cff150","type":"toggle","properties":{"title":[["EXTRA:",[["b"],["h","blue_background"]]],[" Modifica el script anterior para cambiar el mensaje cuando NO exista el fichero."]]},"content":["6a7bac77-a975-4f32-82f8-0c1177d14a74"],"format":{},"created_time":1651194593530,"last_edited_time":1651194600000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"320cf3f1-37f2-4c70-b82b-260149bab611":{"value":{"id":"320cf3f1-37f2-4c70-b82b-260149bab611","type":"toggle","properties":{"title":[["Ejercicio 18",[["b"]]],[": Crea un script"],[" ",[["b"]]],["que te pida un usuario para ver los procesos de ese usuario y los muestre. Después que pida el PID para matar el proceso."]]},"content":["5abb9d57-d6a7-481e-a45c-ef96c348f7f7","e803da3b-ff6a-4d2f-9c84-6b7690bd7858"],"format":{},"created_time":1651191846612,"last_edited_time":1651191840000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"f13726ae-503b-4ba3-9a44-8b9f6d8d1feb":{"value":{"id":"f13726ae-503b-4ba3-9a44-8b9f6d8d1feb","type":"toggle","properties":{"title":[["EXTRA:",[["b"],["h","blue_background"]]],[" Modifica el script anterior para"],[" ",[["b"]]],["que busque solo los procesos de Firefox."]]},"content":["7270657a-66ee-4ba3-b908-c85c915b244a"],"format":{},"created_time":1651194856113,"last_edited_time":1651194960000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"e5685e06-3afa-4ed0-8e27-d49235dce9db":{"value":{"id":"e5685e06-3afa-4ed0-8e27-d49235dce9db","type":"toggle","properties":{"title":[["Ejercicio 19:",[["b"]]],[" Crea un script que cree el número de usuarios que nosotros digamos"]]},"content":["7f63e683-7606-411f-ae8b-f6d2f9131654"],"format":{},"created_time":1651192507769,"last_edited_time":1651192500000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"8796c2f7-2cd3-4d2e-969a-92c9154decc0":{"value":{"id":"8796c2f7-2cd3-4d2e-969a-92c9154decc0","type":"toggle","properties":{"title":[["EXTRA:",[["b"],["h","blue_background"]]],[" Modifica el script anterior para pasar el número de usuarios nuevos por parámetro."]]},"content":["7a36f818-4fb2-431c-b955-0f2b5a9b6f32"],"format":{},"created_time":1651194856679,"last_edited_time":1651194960000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"9f805d8e-58dc-48de-95d7-680aa586e6fa":{"value":{"id":"9f805d8e-58dc-48de-95d7-680aa586e6fa","type":"toggle","properties":{"title":[["Ejercicio 20:",[["b"]]],[" Crea un script como una Calculadora"]]},"content":["31f8ece1-3222-4ba5-ae4d-121f711cf8db","aa40b2df-92f5-4c2a-a063-926479c6e2f2"],"format":{},"created_time":1651192918764,"last_edited_time":1651192920000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"ae9418f7-610b-4b10-8879-f8b922dd48f8":{"value":{"id":"ae9418f7-610b-4b10-8879-f8b922dd48f8","type":"factory","properties":{"title":[["EJERCICIO XX"]]},"content":["dc60407d-b666-4bb3-90d2-384c9c06b35c"],"created_time":1651192467688,"last_edited_time":1651192500000,"parent_id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"dc60407d-b666-4bb3-90d2-384c9c06b35c":{"value":{"id":"dc60407d-b666-4bb3-90d2-384c9c06b35c","type":"toggle","properties":{"title":[["Ejercicio XX:",[["b"]]],[" "]]},"content":["afffe4e9-82e6-4302-be0b-6a9884b0e18e"],"created_time":1651192393611,"last_edited_time":1651192500000,"parent_id":"ae9418f7-610b-4b10-8879-f8b922dd48f8","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"8b17fc57-34b1-427e-8327-ab64fa4e9797":{"value":{"id":"8b17fc57-34b1-427e-8327-ab64fa4e9797","type":"code","properties":{"title":[["#!/bin/bash\necho -n \"Pon tu año de nacimineto: \"; read anno\necho -n \"Pon tu Nombre: \"; read name\nannoA=$(date +%Y)\nedad=$[$annoA - $anno]\necho \"Tu edad es de $edad y tu nombre es $name\""]],"language":[["Bash"]]},"created_time":1650915269415,"last_edited_time":1650998520000,"parent_id":"714dd689-e6a4-4d5b-8b22-8a023d30e50d","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"287742cd-a8a5-450b-8180-ed284e6068e5":{"value":{"id":"287742cd-a8a5-450b-8180-ed284e6068e5","type":"code","properties":{"title":[["#!/bin/bash\ndate=$(date +%x)\nhora=$(date +%X)\nuser=$(cut -d: -f1 /etc/passwd)\necho \"\n--------------------------------------------------------------------------------\nFecha: $date\nHora: $hora \nUser's: \n$user\" \u003e\u003e resultado.txt"]],"language":[["Bash"]]},"created_time":1650987316706,"last_edited_time":1650997440000,"parent_id":"b301c2cb-0460-4ef5-a1f2-75e109af3491","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"3dccf129-5209-42f7-9374-6480063150aa":{"value":{"id":"3dccf129-5209-42f7-9374-6480063150aa","type":"code","properties":{"title":[["#!/bin/bash\nps -fea | grep ubuntu \u003e\u003e procesos.txt \u0026\u0026 cat procesos.txt"]],"language":[["Bash"]]},"created_time":1650987322303,"last_edited_time":1650997260000,"parent_id":"08cfe0d1-52ca-4b4a-8444-68a89434a655","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"3b02a92d-67fe-41f7-80e8-f98aec0082cf":{"value":{"id":"3b02a92d-67fe-41f7-80e8-f98aec0082cf","type":"code","properties":{"title":[["#!/bin/bash\necho -n \"¿De que usuario quieres ver los procesos? \"; read usuario\nps -fea | grep $usuario \u003e\u003e procesos.txt \u0026\u0026 cat procesos.txt"]],"language":[["Bash"]]},"created_time":1650987330776,"last_edited_time":1650998460000,"parent_id":"36b51db9-0c8b-4410-bfcb-40b35d972c45","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"d6ee1a10-abfa-427d-881b-b6172f07ba17":{"value":{"id":"d6ee1a10-abfa-427d-881b-b6172f07ba17","type":"code","properties":{"title":[["#!/bin/bash\necho -n \"Pon tu año de nacimineto: \"; read anno\necho -n \"Pon tu Nombre: \"; read name\nannoA=$(date +%Y)\nedad=$[$annoA - $anno]\necho \nif [ $edad -ge 18 ]\n then\n echo \"Tu edad es de $edad y tu nombre es $name\"\n echo \"Eres mayor de edad\"\n else\n echo \"Tu edad es de $edad y tu nombre es $name\"\n echo \"Eres menor de edad\"\nfi"]],"language":[["Bash"]]},"created_time":1650998359813,"last_edited_time":1650998340000,"parent_id":"0e056eeb-10a7-4746-b9de-b0f6499df394","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"1660398b-a1d0-440f-9dea-68a4cfed5869":{"value":{"id":"1660398b-a1d0-440f-9dea-68a4cfed5869","type":"code","properties":{"title":[["#!/bin/bash\necho -n \"Contraseña: \"; read pass\necho \nif [ $pass != 123456 ]\n then\n echo \"Contraseña correcta ✔️\"\n else\n echo \"Contraseña incorrecta ⛔\"\nfi"]],"language":[["Bash"]]},"created_time":1650998336023,"last_edited_time":1650999120000,"parent_id":"1b40cfc8-f783-4922-a2b5-b266d6f07639","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"e91eb24c-002a-4ab3-8767-bf1aac3d7738":{"value":{"id":"e91eb24c-002a-4ab3-8767-bf1aac3d7738","type":"code","properties":{"title":[["#!/bin/bash\necho \"Introduce tus notas de los examenes\"\necho -n \"Nota 1: \"; read nota1\necho -n \"Nota 2: \"; read nota2\necho -n \"Nota 3: \"; read nota3\nsuma=$[$nota1 + $nota2 + $nota3]\ndivision=$[$suma / 3]\nif [ $division -ge 5 ]; then\n\techo \"APROBADO 😁\"\nelse\n\techo \"SUSPENSO 😔\"\nfi"]],"language":[["Bash"]]},"created_time":1650998730101,"last_edited_time":1651188420000,"parent_id":"cf3891e4-a0ef-4247-bc8c-955e1bd4aeac","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"cf8655bb-89d9-43a8-b16c-b5123e84e0c1":{"value":{"id":"cf8655bb-89d9-43a8-b16c-b5123e84e0c1","type":"code","properties":{"title":[["#bin/bash\nuser=$(whoami)\necho \"Usuario: $user\"\nif [ $user = \"root\" ]\n then\n echo \"Tines todos los permisos 🔒\"\n elif [ $user = \"wiwagner8462\" ]\n then\n echo \"Tienes permisos de WiWagner8462 👾\"\n else\n echo \"⛔ Notienes permisos ⛔\"\nfi"]],"language":[["Bash"]]},"created_time":1651000795642,"last_edited_time":1651001160000,"parent_id":"e835791b-7dfd-41d9-8810-2d0ee3133b83","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"59d172f4-0c6c-4652-81cc-8c23c9d19081":{"value":{"id":"59d172f4-0c6c-4652-81cc-8c23c9d19081","type":"quote","properties":{"title":[["Si metemos 1 🡪 Ha ganado el equipo local\nSi metemos X 🡪 Ha sido empate\nSi metemos 2 🡪 Ha ganado el equipo visitante\nOtra cosa 🡪 Opción no válida"]]},"created_time":1651183877300,"last_edited_time":1651183920000,"parent_id":"a3c17035-12b3-4360-a699-5abe1105cc64","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"c4674f59-0141-467b-aa78-5f77e3e9f62d":{"value":{"id":"c4674f59-0141-467b-aa78-5f77e3e9f62d","type":"code","properties":{"title":[["\n#!/bin/bash\n#Ejercicio case - en caso de...\necho -n \"Escribe el resultado del partido:\"; read res\ncase $res in\n1) echo \"Gana el equipo local 🎉🎉\";;\nX) echo \"Empate..\";;\n2) echo \"Ha ganado el equipo visitante🥲🥲\";;\n*) echo \"Opcion no valida..\" \u0026\u0026 echo \"Se ejetuta el script..\" \u0026\u0026 source 6.sh;;\nesac"]],"language":[["Bash"]]},"created_time":1651183722977,"last_edited_time":1651184700000,"parent_id":"a3c17035-12b3-4360-a699-5abe1105cc64","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"8790c7b6-b6d6-48b3-aca7-51fda23addf9":{"value":{"id":"8790c7b6-b6d6-48b3-aca7-51fda23addf9","type":"quote","properties":{"title":[["Crea un script que diga que:\nEstás suspenso si tienes menos de 5 en nota o más de 10 faltas.\nEstas aprobado si tienes más de 5 y además tienes menos de 10 faltas."]]},"created_time":1651185139997,"last_edited_time":1651185600000,"parent_id":"631212ec-4521-4db1-94a4-1c40512ba0c7","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"88c63e66-bc17-49af-bf68-c1cef75ecfe0":{"value":{"id":"88c63e66-bc17-49af-bf68-c1cef75ecfe0","type":"code","properties":{"title":[["#!/bin/bash\n#Ejercicio condicion doble\necho -n \"Introduce tu nota: \"; read nota\necho -n \"Introduce tus faltas: \"; read faltas\nif [ $nota -ge 5 ] \u0026\u0026 [ $faltas -lt 10 ]; then\n\techo \"APROBADO 😁\"\nfi\nif [ $nota -lt 5 ] || [ $faltas -ge 10 ]; then\n\techo \"SUSPENSO 😔\"\nfi"]],"language":[["Bash"]]},"created_time":1651185212675,"last_edited_time":1651185600000,"parent_id":"631212ec-4521-4db1-94a4-1c40512ba0c7","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"4f3f1526-c6fc-4f2f-a2cf-102b8841bea6":{"value":{"id":"4f3f1526-c6fc-4f2f-a2cf-102b8841bea6","type":"text","created_time":1651185480000,"last_edited_time":1651185600000,"parent_id":"631212ec-4521-4db1-94a4-1c40512ba0c7","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"da12336d-7415-423b-920a-a03e280e5d26":{"value":{"id":"da12336d-7415-423b-920a-a03e280e5d26","type":"code","properties":{"title":[["#!/bin/bash\n#Ejercicio bucle\necho -n \"Introduce un numero: \"; read num\nwhile [ $num -ne 0 ]\ndo\n\techo \"⛔ Numero incorrecto ⛔\" \u0026\u0026 echo -n \"Repitelo: \"; read num\ndone\necho \"Numero correcto 🎉\""]],"language":[["Bash"]]},"created_time":1651187326973,"last_edited_time":1651188420000,"parent_id":"4d7d3419-c796-4967-97a9-565fd2b316d0","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"6a8e577d-8016-4252-8dc3-a687cd7150a9":{"value":{"id":"6a8e577d-8016-4252-8dc3-a687cd7150a9","type":"code","properties":{"title":[["#!/bin/bash\n#ejercicio para casa bucle\necho -n \"Introduce la password: \"; read pass\nint=1\nwhile [ $pass != \"hola\" ]\ndo\n echo -n \"⛔ Vuelva a introducir la contrasena: \"; read pass\ndone\necho \"La contraseña es correcta 🎉\""]],"language":[["Bash"]]},"created_time":1651188153699,"last_edited_time":1651188360000,"parent_id":"4f43a11e-0bae-4c85-a6fe-94cdd35360ee","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"f44375bb-421c-48be-b3d6-680bd0ae13a9":{"value":{"id":"f44375bb-421c-48be-b3d6-680bd0ae13a9","type":"code","properties":{"title":[["#!/bin/bash\n#ejercicio para casa bucle\necho -n \"Introduce la password: \"; read pass\nint=1\nwhile [ $pass != \"hola\" ] \u0026\u0026 [ $int -lt 3 ]\ndo\n echo -n \"Vuelva a introducir la contrasena: \";read pass\n int=$[$int + 1]\ndone\nif [ $pass = \"hola\" ]; then\n echo \"La contraseña es correcta 🎉\"\nelse\n echo \"⛔ La cuenta ha sido bloqueada ⛔\"\nfi"]],"language":[["Bash"]]},"created_time":1651188560656,"last_edited_time":1651188720000,"parent_id":"58b7bae2-ba57-45bb-bf65-f234918ba160","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"d2723ba5-8b12-4d6e-83a7-d66f024b98b8":{"value":{"id":"d2723ba5-8b12-4d6e-83a7-d66f024b98b8","type":"code","properties":{"title":[["#!/bin/bash\n#ejercicio sumar los 100 primeros numeros\nfor num in `seq 1 100`;\ndo\n suma=$[$suma + $num]\n echo $suma\ndone"]],"language":[["Bash"]]},"created_time":1651189017264,"last_edited_time":1651189080000,"parent_id":"6cadbe16-a8e5-46d4-8cfa-dfeb9ffd93a3","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"8613a876-f850-4735-b397-46b9184a7b7e":{"value":{"id":"8613a876-f850-4735-b397-46b9184a7b7e","type":"code","properties":{"title":[["#!/bin/bash\n#ejercicio edad\necho -n \"Introduzca su edad: \"; read edad\nif [ $edad -ge 18 ] \u0026\u0026 [ $edad -le 67 ]; then\n echo \"Puedes trabajar\"\nelse\n echo \"No puedes trabajar\"\nfi"]],"language":[["Bash"]]},"format":{},"created_time":1651189154555,"last_edited_time":1651189260000,"parent_id":"97f36687-34bf-4499-87a4-875a50983c61","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"35399939-30db-452b-bff9-2ef70e25f7fa":{"value":{"id":"35399939-30db-452b-bff9-2ef70e25f7fa","type":"code","properties":{"title":[["#!/bin/bash\n#ejercicio sumar nums\necho -n \"Introduzca un numero: \";read num\nsuma=$num\nwhile [ $num -ne 0 ] \ndo\n echo -n \"Introduce otro numero: \";read num\n suma=$[$suma + $num]\ndone\n echo \"La suma es $suma\""]],"language":[["Bash"]]},"format":{},"created_time":1651189276177,"last_edited_time":1651189380000,"parent_id":"a6ee37df-1534-4d59-a9bf-ef1e2aba0a18","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"8da90e8b-96c2-4b3a-a741-4ed8ee469113":{"value":{"id":"8da90e8b-96c2-4b3a-a741-4ed8ee469113","type":"code","properties":{"title":[["#!/bin/bash\n#ejercicio resta\nrest=100\nwhile [ $rest -gt 0 ]\ndo\n echo \"Tienes $rest.\" \u0026\u0026 echo -n \"Introduce un numero para restra: \"; read num\n rest=$[$rest - $num]\ndone\n echo \"La resta ya ha llegado a 0\""]],"language":[["Bash"]]},"format":{},"created_time":1651189450704,"last_edited_time":1651189680000,"parent_id":"08195686-54cc-4bf6-b060-b2ac83746458","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"9a282164-d43b-4995-a30a-c49e7839e11b":{"value":{"id":"9a282164-d43b-4995-a30a-c49e7839e11b","type":"code","properties":{"title":[["#!/bin/bash\n#ejercicio escribir números pares hasta el 1000\nfor num in `seq 1 500`;\ndo\n par=$[$num * 2]\n echo $par\ndone"]],"language":[["Bash"]]},"format":{},"created_time":1651190212181,"last_edited_time":1651190280000,"parent_id":"20642607-35ed-4919-9aa5-bd953c4df0d4","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"0af0de52-9308-46bf-9b06-f51276984f64":{"value":{"id":"0af0de52-9308-46bf-9b06-f51276984f64","type":"code","properties":{"title":[["#!/bin/bash\n#ejercicio asteriscos que tu introduzcas con parámetros\nfor num in `seq 1 $1`;\ndo\n echo \"*\"\ndone"]],"language":[["Bash"]]},"format":{},"created_time":1651190702529,"last_edited_time":1651190940000,"parent_id":"07662e59-3400-4618-b02c-17bb32a91288","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"8cd6eb98-d500-4aec-896c-db3259e2b5bd":{"value":{"id":"8cd6eb98-d500-4aec-896c-db3259e2b5bd","type":"text","created_time":1651190940000,"last_edited_time":1651190940000,"parent_id":"07662e59-3400-4618-b02c-17bb32a91288","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"116abb61-bdaf-4730-b7a9-731c880c2ba3":{"value":{"id":"116abb61-bdaf-4730-b7a9-731c880c2ba3","type":"code","properties":{"title":[["#!/bin/bash\n#ejercicio crear carpeta\nfor num in `seq 1 $1`;\ndo\n mkdir Carpeta_del_usuario$num\ndone\n ls"]],"language":[["Bash"]]},"format":{},"created_time":1651190995379,"last_edited_time":1651191180000,"parent_id":"5a2195ba-f783-4a67-b0e0-e20143d3e341","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"2ffddf9e-0e25-45fd-bffd-e384e33c9194":{"value":{"id":"2ffddf9e-0e25-45fd-bffd-e384e33c9194","type":"text","format":{},"created_time":1651190995379,"last_edited_time":1651190940000,"parent_id":"5a2195ba-f783-4a67-b0e0-e20143d3e341","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"c352edb0-203e-4a24-b466-fb07e03b8c5b":{"value":{"id":"c352edb0-203e-4a24-b466-fb07e03b8c5b","type":"code","properties":{"title":[["#!/bin/bash\n#ejercicio cuentalineas wc -l\nwc -l $1"]],"language":[["Bash"]]},"format":{},"created_time":1651191267981,"last_edited_time":1651191840000,"parent_id":"da7a8b9a-0a31-42a4-a396-32de84419513","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"adb8bad6-7831-4b4e-9155-613aff52dfed":{"value":{"id":"adb8bad6-7831-4b4e-9155-613aff52dfed","type":"text","format":{},"created_time":1651191267981,"last_edited_time":1651191240000,"parent_id":"da7a8b9a-0a31-42a4-a396-32de84419513","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"6a7bac77-a975-4f32-82f8-0c1177d14a74":{"value":{"id":"6a7bac77-a975-4f32-82f8-0c1177d14a74","type":"code","properties":{"title":[["#!/bin/bash\n#ejercicio cuentalineas wc -l\nif [ ! -e $1 ];\nthen\n\techo \"El fichero $1 no existe\"\nelse\n\techo \"El archivo $1 tiene \"\n wc -l $1\nfi"]],"language":[["Bash"]]},"format":{},"created_time":1651194593530,"last_edited_time":1651194780000,"parent_id":"a04f6391-5c77-470a-84c3-b300b1cff150","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"5abb9d57-d6a7-481e-a45c-ef96c348f7f7":{"value":{"id":"5abb9d57-d6a7-481e-a45c-ef96c348f7f7","type":"code","properties":{"title":[["#!/bin/bash\n#ejercicio matar proceso\necho -n \"Introduce el usuario del que deseas ver los procesos: \";read user\n sudo ps -fea $user\necho -n \"Introduce el PID del proceso para matarlo: \";read pid\n kill $pid\n echo \"Proceso detenido\""]],"language":[["Bash"]]},"format":{},"created_time":1651191846612,"last_edited_time":1651192320000,"parent_id":"320cf3f1-37f2-4c70-b82b-260149bab611","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"e803da3b-ff6a-4d2f-9c84-6b7690bd7858":{"value":{"id":"e803da3b-ff6a-4d2f-9c84-6b7690bd7858","type":"text","format":{},"created_time":1651191846612,"last_edited_time":1651191840000,"parent_id":"320cf3f1-37f2-4c70-b82b-260149bab611","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"7270657a-66ee-4ba3-b908-c85c915b244a":{"value":{"id":"7270657a-66ee-4ba3-b908-c85c915b244a","type":"code","properties":{"title":[["#!/bin/bash\n#ejercicio matar proceso\nps -fea | grep \"firefox\"\n echo -n \"Introduce el PID del proceso para matarlo: \"; read pid\nkill $pid\n echo \"Proceso detenido.\""]],"language":[["Bash"]]},"format":{},"created_time":1651194856113,"last_edited_time":1651194960000,"parent_id":"f13726ae-503b-4ba3-9a44-8b9f6d8d1feb","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"7f63e683-7606-411f-ae8b-f6d2f9131654":{"value":{"id":"7f63e683-7606-411f-ae8b-f6d2f9131654","type":"code","properties":{"title":[["#!/bin/bash\n#crear usuarios\necho -n \"¿Cuantos usuarios quieres crear? \"; read num\nfor usu in `seq 1 $num`;\ndo\n sudo useradd -d /home/user-$usu User-$usu\ndone"]],"language":[["Bash"]]},"format":{},"created_time":1651192507770,"last_edited_time":1651192860000,"parent_id":"e5685e06-3afa-4ed0-8e27-d49235dce9db","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"7a36f818-4fb2-431c-b955-0f2b5a9b6f32":{"value":{"id":"7a36f818-4fb2-431c-b955-0f2b5a9b6f32","type":"code","properties":{"title":[["#!/bin/bash\n#crear usuarios\nfor usu in `seq 1 $1`;\ndo\n sudo useradd -d /home/user-$usu User-$usu\ndone"]],"language":[["Bash"]]},"format":{},"created_time":1651194856679,"last_edited_time":1651195020000,"parent_id":"8796c2f7-2cd3-4d2e-969a-92c9154decc0","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"31f8ece1-3222-4ba5-ae4d-121f711cf8db":{"value":{"id":"31f8ece1-3222-4ba5-ae4d-121f711cf8db","type":"quote","properties":{"title":[["1- sumar\n2- restar\n3- multiplicar\n4- dividir\n5- salir"]]},"created_time":1651192949477,"last_edited_time":1651192920000,"parent_id":"9f805d8e-58dc-48de-95d7-680aa586e6fa","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"aa40b2df-92f5-4c2a-a063-926479c6e2f2":{"value":{"id":"aa40b2df-92f5-4c2a-a063-926479c6e2f2","type":"code","properties":{"title":[["#!/bin/bash\nnum=1\nwhile [ $num -ne 5 ]\n do\n echo \"Opciones:\" \u0026\u0026 echo \"1. Sumar\" \u0026\u0026 echo \"2. Restar\" \u0026\u0026 echo \"3. Multiplicar\" \u0026\u0026 echo \"4. Dividir\" \u0026\u0026 echo \"5. Salir\"\n echo -n \"¿Que quieres hacer? \"; read num\n if [ $num -eq 1 ];\n then\n clear\n echo -n \"Introduce el número: \"; read suma1\n echo -n \"Introduce el número que quieras Sumar: \"; read suma2\n suma=$[$suma1 + $suma2]\n echo \"El resultado de la Suma es de $suma.\"\n echo \"------------------------------------------------------\"\n fi\n if [ $num -eq 2 ];\n then\n clear\n echo -n \"Introduce el número: \"; read resta1\n echo -n \"Introduce el número que quieras Restar: \"; read resta2\n resta=$[$resta1 - $resta2]\n echo \"El resultado de la Resta es de $resta.\"\n echo \"------------------------------------------------------\"\n fi\n if [ $num -eq 3 ];\n then\n clear\n echo \"Introduce el primer número: \"; read mul1\n echo \"Introduce el número por cual quieres Multiplicar: \"; read mul2\n mul=$[$mul1 * $mul2]\n echo \"El resultado de la Multiplicación es de $mul.\"\n echo \"------------------------------------------------------\"\n fi\n if [ $num -eq 4 ];\n then\n clear\n echo -n \"Introduce el número: \"; read div1\n echo -n \"Introduce el número por cual vas a Dividir: \"; read div2\n res=$[$div1 % $div2]\n div=$[$div1 / $div2]\n echo \"El resultado es $div y el resto es $res\"\n echo \"------------------------------------------------------\"\n fi\n if [ $num -gt 5 ];\n then\n clear\n echo \"Operacion no valida. Introduzca un número del 1 al 5\"\n echo \"------------------------------------------------------\"\n fi\ndone\necho \"FIN..\""]],"language":[["Bash"]]},"format":{},"created_time":1651192918764,"last_edited_time":1651194480000,"parent_id":"9f805d8e-58dc-48de-95d7-680aa586e6fa","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}},"afffe4e9-82e6-4302-be0b-6a9884b0e18e":{"value":{"id":"afffe4e9-82e6-4302-be0b-6a9884b0e18e","type":"code","properties":{"language":[["Bash"]]},"created_time":1651192442488,"last_edited_time":1651192440000,"parent_id":"dc60407d-b666-4bb3-90d2-384c9c06b35c","parent_table":"block","created_by_id":"ffa63290-e940-4136-96a7-0606f1a8f203"}}},"space":{},"collection":{},"collection_view":{},"notion_user":{},"collection_query":{},"signed_urls":{"3e8e1fa2-d7e1-441c-975f-dc4f43470b23":"https://images.unsplash.com/photo-1508830524289-0adcbe822b40?ixlib=rb-1.2.1\u0026q=85\u0026fm=jpg\u0026crop=entropy\u0026cs=srgb"}},"tableOfContents":[],"title":"3º Trimestre","customizations":{},"pageId":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","sidebarTree":{"id":"3e8e1fa2-d7e1-441c-975f-dc4f43470b23","slug":"/3-trimestre-3e8e1fa2d7e1441c975fdc4f43470b23","depth":0,"title":"3º Trimestre","iconUrl":"https://blog.toright.com/wp-content/uploads/2019/05/bash.png","children":[]},"topBannerHtml":"","injectCodeInHead":"","seoTitleSuffix":"","footerJson":null,"faviconUrl":"https://notaku.website/[email protected]","ogImgSrc":"https://notaku.website/api/images/https~~3A~~2F~~2Fimages.unsplash.com~~2Fphoto-1508830524289-0adcbe822b40~~3Fixlib~~3Drb-1.2.1~~26q~~3D85~~26fm~~3Djpg~~26crop~~3Dentropy~~26cs~~3Dsrgb?wrapWithNotionId=3e8e1fa2-d7e1-441c-975f-dc4f43470b23"},"__N_SSP":true},"page":"/_hosts/[host]","query":{"host":"iso_3t.notaku.site"},"buildId":"e_jO2uw80yJAqGKES3uNK","isFallback":false,"gssp":true,"scriptLoader":[]}</script><next-route-announcer><p aria-live="assertive" id="__next-route-announcer__" role="alert" style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; width: 1px; white-space: nowrap; overflow-wrap: normal;"></p></next-route-announcer></body></html>