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.

4
  • 1
    As the bash tag you used instructs - "For shell scripts with syntax or other errors, please check them at shellcheck.net before posting them here."
    – Ed Morton
    Commented Jun 25, 2023 at 13:28
  • 1
    assuming the objective is to capture the results of the echo | grep in the variable DOMAIN ... DOMAIN=$(echo "$1" | grep -P -o $REGEX)
    – markp-fuso
    Commented Jun 25, 2023 at 13:51
  • @markp-fuso Thank you, it should be an answer....
    – vaso123
    Commented Jun 25, 2023 at 14:07
  • 1
    @vaso123 var=$(command) is a pretty basic concept in (unix/linux) shell scripting; not really worthy of an answer; I would recommend reviewing the linked 'duplicates' for other, more efficient, methods of parsing a string; good luck
    – markp-fuso
    Commented Jun 25, 2023 at 14:14