SHELL Script Example: arithmetic operation in shell script
SHELL Script Example: how to do arithmetic operation in shell script?
create a file named "shell-script-example-arithmetic-tutorial.sh" then copy and paste the below code:
#!/bin/bash
FirstNumber=500;
SecondNumber=10;
Result=$((FirstNumber+SecondNumber));
echo "FirstNumber={$FirstNumber}, SecondNumber={$SecondNumber}, sum={$Result}";
SHELL Script Example: arithmetic operation in shell script?
Now run the program (shell-script-example-arithmetic-tutorial.sh) from shell command prompt & get the result as follows:
SHELL Script Example: arithmetic operation in shell script - output in the shell command prompt
Related Tutorial Examples
- Unix wc-l Equivalent DOS Command Using C Program
- Parse Command Line Argument Input Using SHELL Script
- AWK SHELL Script File Last Modification Information Changing Delimiter
- UNIX Command Example: spell - Display Spelling Mistake
- UNIX Command Example: sort - Sort contents of a File
- UNIX Command Example: tail - Read Last Portion of a file
- UNIX Command Example: more - Continuously read a file
- 20 Steps to Make CakePHP Blog Project
- 28 Tutorials to Learn Oracle
- 19 Examples to Learn MySQL

No comments:
Post a Comment
leave your comments here..