Advertisement
PaweU

slownikbash

Nov 29th, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.61 KB | None | 0 0
  1.   GNU nano 2.5.3               Plik: slownik.sh                           Zmodyfikowany  
  2.  
  3. #!/bin/bash
  4.  
  5. if [ ! -f "dictionaryen.txt" ]
  6. then
  7.         echo "Nie ma slownika."
  8.         exit
  9. fi
  10.  
  11. if [ $# -lt 1 ]
  12. then
  13.         echo "Nie podano slowa. Mozesz wpisac je teraz:"
  14.         read word
  15. else
  16.         word=$1
  17. fi
  18.  
  19.  
  20. szukane=`grep -E "^$word$" dictionaryen.txt`
  21.  
  22. #if [ "$word" == "^*[^a-c]*$" ]
  23. #then
  24. #       echo "Blad."
  25. #       exit
  26. #fi
  27.  
  28. if [ "$szukane" == "" ]
  29. then
  30.         echo "Brak wynikow."
  31. else
  32.         echo "Znaleziono takie slowa pasujace do podanego argumentu:"
  33.         echo $szukane
  34. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement