Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nivekastoreth/b9cdb4580798538e39131cf6ae75292a to your computer and use it in GitHub Desktop.
Save nivekastoreth/b9cdb4580798538e39131cf6ae75292a to your computer and use it in GitHub Desktop.
lmgtfy
jmaki@jmaki-pc ~
$ cat piping.sh
#!/bin/bash
echo >&1 "This is writing to stdout"
echo >&2 "This is writing to stderr"
jmaki@jmaki-pc ~
$ cat lmgtfy.sh
#!/bin/bash
search_string=$(echo "$@" | tr ' ' '+')
lynx --cookies "https://www.google.com/search?q=${search_string}"
jmaki@jmaki-pc ~
$ ./piping.sh 2>&1 >/dev/null | xargs ./lmgtfy.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment