-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreatescripts.sh
More file actions
52 lines (38 loc) · 1.78 KB
/
createscripts.sh
File metadata and controls
52 lines (38 loc) · 1.78 KB
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
#!/bin/bash
# Script que ayuda a generar scripts profesionales
# Variables de color de texto
red='\033[31m'
reset='\033[0m'
echo "======================================================"
echo "*- Usuario: Este script te ayudara ha generar -*"
echo "*- Scripts profesionalmente -*"
echo -e "${red}Nota:${reset}El nombre de el script "
echo " no debe de tener espacios si esta compuesta "
echo " por 2 palabras, utilice un guion para unirlas "
echo " y no coloque la extension .sh "
echo "======================================================"
echo "======================================================"
echo "=== Digite el nombre del script: ==="
echo "======================================================"
read namescript
echo "======================================================"
echo "=== Se genera el archivo $namescript.sh: ==="
echo "======================================================"
touch $namescript.sh
echo "======================================================"
echo "=== Se agrega permisos de EXEC $namescript.sh: ==="
echo "======================================================"
chmod u+x $namescript.sh -v
echo "======================================================"
echo "=== Se agrega encabezado BASH $namescript.sh: ==="
echo "======================================================"
echo '#!/bin/bash' > $namescript.sh
echo "======================================================"
echo "=== Se verifica PERM $namescript.sh: ==="
echo "======================================================"
ls -lh $namescript.sh
function pausa(){
read -p "$*"
}
pausa 'Presione [ENTER] para continuar con la edición del script'
nano $namescript.sh