Lanka Developers Community

    Lanka Developers

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Shop

    Arithmetic operators in BASH scripting

    Linux
    bash scripting linux
    2
    2
    436
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • binurayeshan
      binurayeshan Linux Help last edited by

      අද කතා කරන්නේ Basic Arithmetic operators ටික ගැන. ඒ කියන්නෙ එකතු කිරීම, අඩු කිරීම , බෙදීම , ගුන කිරීම.

      ඔයාල දැන් දන්නවනේ කොහොමද bash script file එකක් හදාගන්නෙ කියල.. දන්නෙ නැති අය මෙ Link එක Use කරල ඔක්කොම ටික බලන්න - https://binurayeshan.blogspot.com

      හරි දැන් ඔයාලා හදා ගත්ත script file එකේ මෙන්න මේ code line ටික type කරන්න.

      #!/bin/bash
      
      a=2
      b=5
      c=9
      
      echo "$a,$b,$c"
      
      echo "Sum of variable are = $[a+b+c]" #එකතු කිරිම්
      
      echo "Value of c MOD b = $[c%b] " #mod එක ඒ කියන්නෙ බෙදුවම එන ඉතිරිය
      
      echo "Value of c MOD b = $[c-b] " #අඩු කිරීම
      
      echo "Value of a * c = $[a*c]" #ගුණ කිරීම
      
      echo "Value of c / b = $[c/b]"  #බෙදීම
      
      

      :male-technologist: :sunglasses:
      0_1570406256663_Screen Shot 2019-10-07 at 5.27.33 AM.png

      1 Reply Last reply Reply Quote 2
      • Nubelle
        Nubelle Web Development last edited by

        patta pata machn

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post

        0
        Online

        3.6k
        Users

        1.3k
        Topics

        5.3k
        Posts

        • Privacy
        • Terms & Conditions
        • Donate

        © Copyrights and All right reserved Lanka Developers Community

        Powered by Axis Technologies (PVT) Ltd

        Made with in Sri Lanka

        | |