Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I know it is basic question but i am unable to write simple addition program in unix. i am using cygwin to write the shell script my script is this
#!/bin/sh echo "enter the first number" read a echo "enter the seconf number" read b echo [$a + $b]
#!/bin/sh echo "enter the first number" read a echo "enter the seconf number" read b echo $(($a+$b))
Add a comment
To add two numbers, you can do this:
let c = $a + $b echo $c
To read, you can do:
read -p "Enter the first number" a read -p "Enter the second number" b
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.