shell script for byobu commands

偶尔善良 提交于 2019-12-05 04:15:36

I think you are missing the first line from your shell script. See if this works

#!/bin/sh
# byobu_launcher.sh ver 20170915122301 Copyright 2017 alexx, MIT Licence ver 1.0

byobu new-session -d -s $USER

# redis window
byobu rename-window -t $USER:0 'redis-cli'
byoby send-keys "redis-cli" C-m
byobu split-window -v

# mongod
byobu new-window -t $USER:1 -n 'mongod'
byobu send-keys "sudo mongod --port 27017 --dbpath /data/db/rs0 --replSet rs0" C-m

# mongo
byobu new-window -t $USER:1 -n 'mongo'
byobu send-keys "mong" C-m

# Set default window as the dev split plane
byobu select-window -t $USER:1

# Attach to the session you just created
# (flip between windows with alt -left and right)
byobu attach-session -t $USER

with screen you can do this bu adding to the end of ~/.screenrc

screen -t redis-cli 0
stuff "redis-cli\n"
screen -t mongod 1
stuff "sudo mongod --port 27017 --dbpath /data/db/rs0 --replSet rs0\n"
screen -t mongo 2
stuff "mongo\n"
select 1

I mostly use screen and sometimes use tmux. I haven't used byoby.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!