Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rdemeter
GitHub Repository: rdemeter/so
Path: blob/master/lab0/is_positiv.sh
217 views
1
#!/bin/sh
2
#
3
# Script pentru a observa daca argumentul este pozitiv sau negativ
4
#
5
if [ $# -eq 0 ]; then
6
echo "$0 : Trebuie sa introduceti un intreg"
7
exit 1
8
fi
9
10
if test $1 -ge 0; then
11
echo " $1 este un numar pozitiv"
12
else
13
echo " $1 este un numar negativ"
14
fi
15
16