Docsity
Docsity

Prepara tus exámenes
Prepara tus exámenes

Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity


Consigue puntos base para descargar
Consigue puntos base para descargar

Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium


Orientación Universidad
Orientación Universidad


Scripts 2 Software de simulacion ejercicios, Ejercicios de Sistemas Operativos

Scripts 2 Software de simulacion ejercicios Programacion

Tipo: Ejercicios

2018/2019

Subido el 23/10/2019

dana-mejiaz
dana-mejiaz 🇪🇨

2 documentos

1 / 3

Toggle sidebar

Esta página no es visible en la vista previa

¡No te pierdas las partes importantes!

bg1
#!/bin/bash
clear
nl secuencia.txt > lista.txt
opc=1
while [ $opc != c ]
do
echo QUE ACCION DESEA REALIZAR?
echo a. Añadir un nombre
echo b. Mostrar la lista de nombres
echo c. Salir
read opc
if [ $opc == a ]
then
echo Ingrese nombre para añadirlo a la lista
read nombre
echo $nombre >> secuencia.txt
nl secuencia.txt > lista.txt
echo NOMBRE AÑADIDO CON EXITO!!!
echo Desea volver al menu principal?
echo 1. SI
echo 2. NO
read opc2
if [[ (($opc2 == 1)) ]]
then
opc=1
clear
else
clear
echo HASTA LUEGO
sleep 3
opc=c
fi
fi
if [ $opc == b ]
then
clear
echo LISTA ORDENADA
cat lista.txt
echo Desea volver al menu principal?
echo 1. SI
echo 2. NO
read opc2
if [[ (($opc2 == 1)) ]]
then
opc=1
clear
else
clear
pf3

Vista previa parcial del texto

¡Descarga Scripts 2 Software de simulacion ejercicios y más Ejercicios en PDF de Sistemas Operativos solo en Docsity!

#!/bin/bash clear

nl secuencia.txt > lista.txt opc=

while [ $opc != c ] do

echo QUE ACCION DESEA REALIZAR? echo a. Añadir un nombre echo b. Mostrar la lista de nombres echo c. Salir read opc

if [ $opc == a ] then echo Ingrese nombre para añadirlo a la lista read nombre echo $nombre >> secuencia.txt nl secuencia.txt > lista.txt echo NOMBRE AÑADIDO CON EXITO!!! echo Desea volver al menu principal? echo 1. SI echo 2. NO read opc

if [[ (($opc2 == 1)) ]] then opc= clear else clear echo HASTA LUEGO sleep 3 opc=c fi fi

if [ $opc == b ] then clear echo LISTA ORDENADA cat lista.txt echo Desea volver al menu principal? echo 1. SI echo 2. NO read opc

if [[ (($opc2 == 1)) ]] then opc= clear else clear

echo HASTA LUEGO sleep 3 opc=c fi fi

if [ $opc == c ] then clear echo HASTA LUEGO sleep 3 fi done clear #!/bin/bash rm -r /home/Organizados

mkdir /home/Organizados mkdir /home/Organizados/pdfs mkdir /home/Organizados/txts mkdir /home/Organizados/jpgs cd Documentos n= n2= n3= for i in $( ls ) do

if [ ${i: -3} == 'pdf' ] then

cp $i /home/Organizados/pdfs (( n++ )) fi

if [ ${i: -3} == 'jpg' ] then cp $i /home/Organizados/jpgs (( n2++ )) fi

if [ ${i: -3} == 'txt' ] then cp $i /home/Organizados/txts (( n3++ )) fi done #!/bin/bash clear echo "PML- QRS- LTR- FGP- OPR-123" > leer.txt cat leer.txt