fixie Posted May 22, 2014 Share Posted May 22, 2014 Here's what I'm wanting to do: 1. I'm going to manually edit a names.txt file (probably stored in dropbox) and each line will be an alphanumeric string 2. For each line in the names.txt I want to open a specific url (in safari or chrome) using the line in the text file as the query. eg: http://who.is/whois/{query}.com where query is the current line in my text file. 3. Repeat for each entry in names.txt. How best to do this? I'm okay with bash/ksh scripts if that helps things. Additionally, is there any way to capture the text contents of a webpage to a file so that I can subsequently grep for specific strings? Link to comment
vitor Posted May 22, 2014 Share Posted May 22, 2014 OS X has open, which will come in handy, here. for line in $(cat "names.txt"); do open "http://who.is/whois/${line}.com" done Regarding your other question, you can do it via curl. Simply do something like curl http://example.com, and it’ll output the page directly to the terminal (from where you can pipe to grep directly). This is not necessarily a good idea, although It could be fine, depending on your needs. fixie 1 Link to comment
fixie Posted May 22, 2014 Author Share Posted May 22, 2014 That's a big help - thanks! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now