Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Use grep -q instead of grep > /dev/null Commented Dec 31, 2023 at 5:49
  • (1) So you're saying that it can't be done in pure bash? If so, you should say so. (2) And do you have a reference or source for saying that it can't be done in pure bash, or are you just offering a grep solution that works? (3) Why do you believe that you need to use -P? (4) Why are you not using here strings? (5) printf "%s" would be better thanecho. (6) Rather than repeating code with different data, consider defining functions. Commented Dec 31, 2023 at 6:00
  • Also (7) consider using grep -q instead of redirecting output to /dev/null. Commented Dec 31, 2023 at 6:00
  • @g-man-says-reinstate-monica If you don't liked my code, why don't you posted your own to the OP and is complaining about what is already done? Commented May 19, 2024 at 3:41