Skip to content

Instantly share code, notes, and snippets.

@cpjobling
Created March 11, 2020 09:34
Show Gist options
  • Save cpjobling/3ffdbe4127d14a9af8d3f320e5837c5d to your computer and use it in GitHub Desktop.
Save cpjobling/3ffdbe4127d14a9af8d3f320e5837c5d to your computer and use it in GitHub Desktop.
#! /bin/bash
# I need to source conda
source ~/anaconda3/bin/activate base
# Find the interesting output in stderr
mycmd='jupyter notebook --no-browser'
exec 3< <($mycmd 2>&1)
a=$(grep -o -m1 'http://localhost.*' <&3)
echo $a
# Use preferred browser here - needs
wlsview "$a"
# This keeps the terminal alive as we get the rest of the output
cat <&3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment