Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #! /bin/bash
  2.  
  3.  
  4. string = "$1"
  5. string2 = "suma"
  6. if [ $string != $string2 ]; then
  7. echo "Incorrect first argument!
  8. Consider using --help"
  9. exit 0
  10.  
  11.  
  12. if [ $# -lt 2 ]; then
  13. echo "Incorrect number of arguments!
  14. Consider using --help"
  15. exit 1
  16. fi
  17.  
  18.  
  19.  
  20. while [ $# -ge 1 ]; do
  21.  
  22. done
  23. shift
  24. while [ $# -ge 1 ]; do
  25. arg=$1
  26. if [ ! "$1" -eq "$1" ] ; then
  27. suma = $suma + $arg
  28. fi
  29.  
  30. shift
  31. done
  32. printf "Suma argumentow: %s" "$arg"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement