code

code


#!/bin/bash

ps

echo "Wybierz cos(CZYTAJ, LISTA, KONIEC)"

read -p "Enter: " x


case $x in

"CZYTAJ")

read -p "Podasz swoja nazwe? Y/n: " nz

if [ $nz == "Y" ];

then read -p "Podaj w formacie - .txt" nazw

if [ -e $nazw ]

then cat $nazw

else

echo "Niema takiego pliku!"

fi

elif [ $nz=="n" ];

then cat plik.txt

else

echo "Zle podana opcja"

fi;;

"LISTA") ls;;

"KONIEC") exit;

*) echo "Niema takiej opcji :)";;

esac

Report Page