I have the code python
import os
# put the words you want to match into a list
matching_words = ["apple", "pear", "car", "house"]
# get some text from the user
user_string = input("Please enter some text:")
# loop over each word in matching_words and check if it is a substring of user_string
for word in matching_words:
if word in user_string:
print("\n{} is in the user string\n\n".format(word))
os.system('/home/raed/Desktop/1.sh')
And I have this code in script
#! /bin/bash
########################
if [ "$2" = "pear" ]; then
echo " This is '$2'"
elif [ "$2" = "apple" ]; then
echo " This is '$2'"
else
echo " This is '$2'"
exit 0
So If I choose any word from list of python code I need the script recognize and print it
I have got this error How to solve it ?!!
Please enter some text:apple
apple is in the user string
/home/raed/Desktop/1.sh: line 10: syntax error: unexpected end of file