I am writing a small shell script to receive an input and match against a text file.
However, the input would be a bigger string than the string in the file, against which I want a match.
User input:
abc-de-ef-gh1
Text in file:
This is test,-de-ef-gh,This is test
I want a positive result if I grep user-input with existing file.
How can I achieve this? I couldn't do it with grep.
abc-d-ef-gh1? How aboutf-gh? How about-gh1? How aboutghor1? Describe the processes by which you would answer those questions; i.e., describe the rules that determine whether a string should match a line. Please do not respond in comments; edit your question to make it clearer and more complete.