Question
Write a shell script program to search whether element is present is in the list or not and also display its position in the list.
Answer :
Word Count : 301
_____ ___ __________ _________ _____ ___ ____ ________ ___ ____ __________.
______ ________ _________ _________ ______ _______ __________.
__________ ______ ________ _____ _________.
____ __________ ______ ____ _____ ___ _____.
______ ________ ____ __________ ___ ___.
_______ _____ ________ ________ _____ _____ __________ ________ ____ ______ _________.
______ _______ __________ ________ _________.
___ ___ _____ __________ _______ ________ ____.
_____ ______ _____ ________ _______ ___ __________.
_______ ______ _____ ________ _______ _____ ____ ____ ________.
______ _________ ____ _________ ___ ___ __________ ____ ______.
______ ______ ______ ______ ____ ___ ______ _____ ___ _____.
______ _____ _______ _______ ________ ___ _______ ________ ____ ___.
______ ____ ____ ___ ______.
_________ ________ ____ ____ _____ ________ _________ __________ __________ ______ _______ ______.
________ _________ _________ _____ ___ ________ _______ _________ ___ ____ ________ ____.
_________ _____ ________ __________ _________ ____ _____ ____ __________ ___ ___ _______.
_____ _____ ______ _____ ________ _________ __________ _____ ________ ___ ______ __________.
____ _______ ________ _______ ___ ___ ________ ____ ________ ___ _________ _________.
_______ ____ ____ ______ _________ ________ _______ _____ ______.
________ ________ _______ ____ ___ _____ __________ ________ _____ _____.
______ _______ ______ ______ ___ ___ ____ __________ _____.
_________ ________ ______ ___ ______ __________ ___ _______ _________ _____ _______.
_____ _________ __________ ____ ______ ___ ______ _______ ___ __________.
_____ _______ ______ __________ _________.
____ _________ ________ ____ _______.
___ _____ __________ ________.
Skip in 10
Here is a shell script program to search whether an element is present in a list and display its position in the list, applicable for both Windows and Linux environments.
```bash
#!/bin/bash
# Define the list of elements
list=("apple" "banana" "cherry" "date" "elderberry")
# Read the element to search
echo "Enter the element to search:"
read search_element
# Initialize flag to check if element is
______ ________ _________ _________ ______ _______ __________.
__________ ______ ________ _____ _________.
____ __________ ______ ____ _____ ___ _____.
______ ________ ____ __________ ___ ___.
_______ _____ ________ ________ _____ _____ __________ ________ ____ ______ _________.
______ _______ __________ ________ _________.
___ ___ _____ __________ _______ ________ ____.
_____ ______ _____ ________ _______ ___ __________.
_______ ______ _____ ________ _______ _____ ____ ____ ________.
______ _________ ____ _________ ___ ___ __________ ____ ______.
______ ______ ______ ______ ____ ___ ______ _____ ___ _____.
______ _____ _______ _______ ________ ___ _______ ________ ____ ___.
______ ____ ____ ___ ______.
_________ ________ ____ ____ _____ ________ _________ __________ __________ ______ _______ ______.
________ _________ _________ _____ ___ ________ _______ _________ ___ ____ ________ ____.
_________ _____ ________ __________ _________ ____ _____ ____ __________ ___ ___ _______.
_____ _____ ______ _____ ________ _________ __________ _____ ________ ___ ______ __________.
____ _______ ________ _______ ___ ___ ________ ____ ________ ___ _________ _________.
_______ ____ ____ ______ _________ ________ _______ _____ ______.
________ ________ _______ ____ ___ _____ __________ ________ _____ _____.
______ _______ ______ ______ ___ ___ ____ __________ _____.
_________ ________ ______ ___ ______ __________ ___ _______ _________ _____ _______.
_____ _________ __________ ____ ______ ___ ______ _______ ___ __________.
_____ _______ ______ __________ _________.
____ _________ ________ ____ _______.
___ _____ __________ ________.
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.