Skip to content

Instantly share code, notes, and snippets.

@helloworld-du
Last active August 29, 2015 14:16
Show Gist options
  • Save helloworld-du/4d5d8b747320518dca9b to your computer and use it in GitHub Desktop.
Save helloworld-du/4d5d8b747320518dca9b to your computer and use it in GitHub Desktop.
tmux初试
#!/bin/bash
set -x
cmd="/usr/bin/tmux" # tmux path
session="hello_tmux" # session name
if [ -z $cmd ]; then
echo "You need to install tmux."
exit 1
fi
$cmd has -t $session
if [ $? != 0 ]; then
$cmd new-session -d -s $session "ifstat"
$cmd split-window -v "tail -f ~/work/var/php/php_errors.log"
$cmd selectp -t 0
$cmd split-window -h "htop"
fi
$cmd attach-session -t $session
#$cmd att -t $session
exit 0
#!/bin/bash
set -x
cmd="/usr/bin/tmux" # tmux path
session="watch" # session name
if [ -z $cmd ]; then
echo "You need to install tmux."
exit 1
fi
$cmd has -t $session
if [ $? != 0 ]; then
$cmd new-session -d -s $session "tail -f ~/work/var/php/php_errors.log"
$cmd split-window -v -p 20
$cmd selectp -t 0
$cmd split-window -h "htop"
$cmd selectp -t 0
$cmd split-window -v -p 75 ' ssh qa "tail -f /tmp/php-error.txt"'
$cmd split-window -v -p 66 'ssh sonia "tail -f /tmp/php-error.txt"'
$cmd split-window -v -p 50 'ssh julia "tail -f /tmp/php-error.txt"'
$cmd selectp -t 5
fi
$cmd attach-session -t $session
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment