Question
(a) Write a shell script program to perform all Arithmetic Operations using Command line arguments.
Answer :
Word Count : 259
__________ ______ _____ _____ ______ __________ _____ _______ ________ ____.
__________ _________ ______ ___ ________ __________.
_______ _________ _______ _____ _____ ___ __________ ______ _________ _______ _____.
____ __________ __________ ___ __________.
______ ________ ________ ______ ____ ____ ____ _________ ___ ______.
_____ ___ __________ _____ ______ _______ ___ __________.
____ _______ ___ ____ __________ _________ ________ ___ _____ __________ ______ ____.
_________ _________ _______ _________ _______ ___ __________.
__________ ______ _________ _________ ___ _______ _______ ________.
_______ ____ ______ ___ __________ ________ ______ ___ ______ __________.
____ ____ _____ ___ ______ ______ ________ ___ __________ ___.
____ _____ _____ ______ _________ ____ ____ ____ _________.
___ ________ ______ ______ _________ __________ ___ _____ _________ ____ ___ _____.
_________ ______ __________ ______ _______ ________ _________ ___ ________ ________.
________ __________ ________ ____ ______ ________ ____.
________ ___ ____ __________ _________ ____ _____ ______ ______ ______.
________ ____ _____ ____ ___ ________ ___ _________ _______ ____ ______.
_______ __________ ___ ____ _______ ______ _____ ________ _____ ______ __________.
__________ ____ __________ ______ ______ _______ ___.
Skip in 10
Sure, I can guide you through creating a shell script that performs all arithmetic operations using command-line arguments. Here's a simple script that you can create:
```bash
#!/bin/bash
# Check if the number of arguments is correct
if [ "$#" -ne 3 ]; then
echo "Usage: $0 <num1> <operator> <num2>"
exit 1
fi
num1=$1
operator=$2
num2=$3
# Perform arithmetic operations based on the operator
case $operator in
+)
__________ _________ ______ ___ ________ __________.
_______ _________ _______ _____ _____ ___ __________ ______ _________ _______ _____.
____ __________ __________ ___ __________.
______ ________ ________ ______ ____ ____ ____ _________ ___ ______.
_____ ___ __________ _____ ______ _______ ___ __________.
____ _______ ___ ____ __________ _________ ________ ___ _____ __________ ______ ____.
_________ _________ _______ _________ _______ ___ __________.
__________ ______ _________ _________ ___ _______ _______ ________.
_______ ____ ______ ___ __________ ________ ______ ___ ______ __________.
____ ____ _____ ___ ______ ______ ________ ___ __________ ___.
____ _____ _____ ______ _________ ____ ____ ____ _________.
___ ________ ______ ______ _________ __________ ___ _____ _________ ____ ___ _____.
_________ ______ __________ ______ _______ ________ _________ ___ ________ ________.
________ __________ ________ ____ ______ ________ ____.
________ ___ ____ __________ _________ ____ _____ ______ ______ ______.
________ ____ _____ ____ ___ ________ ___ _________ _______ ____ ______.
_______ __________ ___ ____ _______ ______ _____ ________ _____ ______ __________.
__________ ____ __________ ______ ______ _______ ___.
IGNOU ACADEMY
Your IGNOU journey, made easier.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
Continue Reading — It's Free
Sign in with Google to unlock more of this answer.
✓ Free access
✓ Unlock up to 60% of the answer
✓ No payment required
✓ Unlock up to 60% of the answer
✓ No payment required
Quick Google sign-in. No separate registration form.