Languages
[Edit]
EN

Bash - get location origin from given URL

0 points
Created by:
martineau
1350

In this article, we would like to show you how to get location origin from given URL in Bash.

Quick solution:

 

Practical example

Edit

In this solution, we use match() function that lets to use regular expression with groups support.

Output:

Reusable example

Edit

Output:

 

See also

Edit
  1. Bash - get domain name from given URL
  2. Bash - get protocol name from given URL

  3. Bash - get path name from given URL

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join