This is a simple bash script that acts as a math calculator. It reads input from a text file, performs arithmetic operations, and saves the results in an output file.
- Bash
-
Clone the repository:
git clone https://github.com/Vikranth3140/Bash-Script-Calculator.git
-
Navigate to the project directory:
cd calculator
-
Place your input in a file named
input.txt
with the following format:7 3 sum 9 6 difference 2 5 product 3 9 division 1 3 xor 5 1 compare
Each line should contain two numbers and an operation.
-
Run the calculator script using the Makefile:
make
The results will be saved in the
output.txt
file.
sum
: Get the sum of two numbers.difference
: Get the difference of two numbers.product
: Get the product of two numbers.division
: Get the division of two numbers.xor
: Get the XOR of two numbers.compare
: Get the bigger number from two given numbers.
calculator/ |-- calculator.sh |-- input.txt |-- Makefile |-- output.txt |-- README.md
Welcome to contribute to the Bash Arithmetic Calculator! Feel free to fork the repository, make UI enhancements, or suggest any improvements. To contribute, follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Push the changes to your fork.
- Submit a pull request.
Thank you for your contributions!