Lanka Developers Community

    Lanka Developers

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

    Sum of two numbers in bash script

    Linux
    bash linux linuxfoundation
    3
    3
    554
    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

      හරි අපි පලෙවෙනි script එකෙන් කතා කලා කොහමද bash script එකක් use karala දෙයක් print කරන්නෙ කියල අද අපි බලමු කොහොමද arithmatic operatorse use කරන්නෙ කියල.

      මම ඔයාලට කලින් post එකෙ කියල දුන්න විදියට bash script file එක හදාගන්න - https://lankadevelopers.com/topic/372/first-bash-script

      #!/bin/bash 
      
      num1=250 #value assign කරන විදිය 
      num2=500 #මතක තියාගන්න මෙ වගේම space තියන්නෙ නැතුව script එක ලියන්න 
      echo "number 1 = " $num1#number 1 එකේ value එක print කරන විදිය 
      echo "number 2 = " $num2
      echo "number 1 + number 2 =" $[num1 + num2]#value දෙකක් එකතු කරන විදිය 
      
      

      ඊට පස්සෙ මේ Script file එකට permission දීලා Run කරන්න

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

        Patta maru mchan

        1 Reply Last reply Reply Quote 0
        • root
          root Linux Help last edited by

          Superb bro

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

          1
          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

          | |