问题描述
我尝试建立一个小脚本,开始我的开发环境。对于任务,我试图打开一个GNOME终端与在自动导轨服务器和自动测试启动几个选项卡。
但
I try to build a little script to start my development environment. For that task I try to open a gnome terminal with several tabs where automatically the rails server and autotest is started.But
gnome-terminal --tab -e "rails server" --tab --tab
不工作(错误创建子进程)。
此外
does not work ("error creating the child process").Also
gnome-terminal --tab -e "bash -c \"rails server\"" --tab --tab`
不起作用。
任何建议如何解决这个问题?
does not work.Any suggestions how to solve that problem?
推荐答案
下面是我们在Superuser
-
添加
的eval$ BASH_POST_RC
来后,你的的.bashrc
设置BASH_POST_RC环境变量对每个选项卡,你要执行该命令,例如: Gnome终端 - 工作目录=/家/ zardoz /项目/ my_rails_app - -Tab -e'的bash -c出口BASH_POST_RC = \\导轨服务器\\; EXEC庆典'--tab -e'的bash -c出口BASH_POST_RC = \\自动测试\\; EXEC庆典
Set the BASH_POST_RC environment variable for each tab to that command you like to execute, e.g.: gnome-terminal --working-directory="/home/zardoz/projects/my_rails_app" --tab -e 'bash -c "export BASH_POST_RC=\"rails server\"; exec bash"' --tab -e 'bash -c "export BASH_POST_RC=\"autotest\"; exec bash"'
:感谢您的解决方案
这篇关于打开GNOME终端编程和被处决的.bashrc后执行命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!