Skip to content

Instantly share code, notes, and snippets.

@jhunt
Last active December 2, 2017 03:17
Show Gist options
  • Save jhunt/9a7275a0967c434a210d0ce8fbd58ba0 to your computer and use it in GitHub Desktop.
Save jhunt/9a7275a0967c434a210d0ce8fbd58ba0 to your computer and use it in GitHub Desktop.
tmux.sh
#!/bin/bash
set -x
if [[ -z $TMUX ]]; then
echo "Not in TMUX; starting one up"
exec tmux new-session -s tmux-test -n bosh \
$0 "$@" \; \
attach
exit 1
fi
echo "In TMUX: running stuff"
for x in $(seq 1 10); do
echo $x
sleep 1
done
echo "BOOM"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment