TL;DR How do you assign the text following the command to a variable in bash?
Ex: /path/to/script [value to assign to variable]
I am writing a script that essentially filters out information from a dig and whois in a format that I like. Right now, I have it set assign user input to the variable for the domain I want to query. I am doing this using 'read'. So it looks like:
read -p "Domain:" domain
This requires running the command and then putting in the domain, whereas I would like to put the domain after the command, similar to what you would do when doing a normal dig or whois.
Such as: ./script google.com
I imagine that its not too complicated and that its a matter of redirecting stdin(0) to a variable. Though I am not sure how to do this.