summaryrefslogtreecommitdiff
path: root/exemple2
diff options
context:
space:
mode:
authorjerome <jerome@xlinfo.fr>2024-03-07 17:06:12 +0100
committerjerome <jerome@xlinfo.fr>2024-03-07 17:06:12 +0100
commitf472fe2ffb102bca3aa9d191fb728e563148f8ba (patch)
tree4a695f556e8ccc684010607dd40e7cfe0185bfe0 /exemple2
downloadbash_tutorial-f472fe2ffb102bca3aa9d191fb728e563148f8ba.tar.gz
bash_tutorial-f472fe2ffb102bca3aa9d191fb728e563148f8ba.zip
commit initial
Diffstat (limited to 'exemple2')
-rwxr-xr-xexemple217
1 files changed, 17 insertions, 0 deletions
diff --git a/exemple2 b/exemple2
new file mode 100755
index 0000000..12b68ed
--- /dev/null
+++ b/exemple2
@@ -0,0 +1,17 @@
+#/usr/bin/bash
+
+# calculs arythmétiques
+a=2
+b=5
+# addition
+c=$((a+b))
+echo $c
+# incrémentation
+((c++))
+echo $c
+# entier négatif
+c=$((a-b))
+echo $c
+# division entière
+c=$((b/a))
+echo $c