Skip to content

Commit 54a9ddd

Browse files
committed
#00 - Bash
1 parent db32cb0 commit 54a9ddd

File tree

1 file changed

+39
-0
lines changed
  • Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/bash

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
# URL del sitio web oficial de Bash: https://www.gnu.org/software/bash/
4+
5+
# COMENTARIOS
6+
7+
# Esto es un comentario de una linea.
8+
9+
: '
10+
Este es un comentario
11+
de varias lineas
12+
'
13+
14+
15+
# VARIABLES
16+
17+
variable=0 # variable
18+
readonly constant="Mi constante" # constante
19+
20+
function my_function {
21+
local variable_local=0 # variable local
22+
}
23+
24+
# TIPOS DE DATOS
25+
26+
variable="String" # String
27+
variable=1 # Int
28+
variable=("rojo" "verde" "azul") # Array
29+
variable=true # Boolean
30+
31+
declare -A dictionary
32+
dictionary[valor]='valor1' # diccionario
33+
34+
# Hola mundo
35+
echo "Hola, Bash!" # echo sirve para imprimir en la terminal
36+
37+
# Para llamar a una variable se usa el simbolo $[nombre de la variable]
38+
variable="Hola Bash"
39+
echo $variable

0 commit comments

Comments
 (0)