Advertisement
ItsMeLucifer

SO Linux Debian GNU nano 3.2

Nov 25th, 2019
470
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.83 KB | None | 0 0
  1. #?/bin/hash
  2. cat pierwszy.sh
  3.  
  4. echo Podaj Liczbe:
  5. read liczba
  6. echo Twoja liczba
  7. echo $liczba
  8.  
  9. exit 0
  10.  
  11. ------
  12. #?/bin/hash
  13. haslo="dajdsadj"
  14. echo "Podaj haslo:"
  15. read haslo
  16. unitl ["$haslo" = "habemus"]
  17. do
  18.     echo "Niepoprawne haslo"
  19.     read haslo
  20. done
  21. echo Witaj na komendzie
  22. exit 0
  23.  
  24. ------
  25. #?/bin/hash
  26. if [ $x -eq 12 ]        //x==12
  27. then
  28.     echo TAK
  29. else
  30.     echo NIE
  31. fi
  32.  
  33. if [ $x -gt 12 ]       //x>12
  34. then
  35.     echo TAK
  36. fi
  37.  
  38. if [ $x -lt 12 ]       //x<12
  39. then
  40.     echo TAK
  41. fi
  42.  
  43. ------
  44. #?/bin/hash   //sprawdza czy podany ciag znakow jest liczba
  45. x="1"
  46. echo Podaj haslo
  47. read x
  48. val=`echo $x : grep -e ^[0-9]+$`
  49. val=`echo $?`
  50. if [ $val -eq 0 ]
  51. then
  52.     echo Warunek Spelniony
  53. else
  54.     echo Warunek niespelniony
  55. fi
  56. exit 0
  57. -----
  58. #?/bin/hash
  59. x="1"
  60. while [[ ! ${x} =~ ^[0-9]+$ ]];do
  61.     echo Podaj liczbe calkowita
  62.     read x
  63. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement