Skip to content

Instantly share code, notes, and snippets.

@gwen001
Last active November 26, 2022 22:56
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save gwen001/cacba9ea0f5c8b36364bfd4681fe852a to your computer and use it in GitHub Desktop.
Save gwen001/cacba9ea0f5c8b36364bfd4681fe852a to your computer and use it in GitHub Desktop.
oneliner to open a bunch of hosts/urls
firefox `cat urls.txt | awk '{if(index($1,"http")){print $1}else{print "http://"$1;print "https://"$1}}'
firefox `cat urls.txt | awk '{if(index($1,"http")){print $1}else{print "http://"$1;print "https://"$1}}' | tr "\n" " "`
chromium-browser `cat urls.txt | awk '{if(index($1,"http")){print $1}else{print "http://"$1;print "https://"$1}}'
chromium-browser `cat urls.txt | awk '{if(index($1,"http")){print $1}else{print "http://"$1;print "https://"$1}}' | tr "\n" " "`
function oopen() {
firefox `cat $1 | awk '{if(index($1,"http")){print $1}else{print "http://"$1;print "https://"$1}}'
}
ALTERNATIVES:
@MaplesonMaple
Firefox/Chrome plugin
https://github.com/htrinter/Open-Multiple-URLs
@honze_net
cat urls.txt | xargs firefox
cat urls.txt | awk '{print ($1 ~ "://") ? $1 : "http://"$1"\nhttps://"$1}' | xargs firefox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment