我想弄清楚如何编写一个脚本,该脚本将在系统启动时在 GNU Screen 会话中启动程序。我正在尝试这个:
#!/bin/bash
screen -S test -d -m -X $HOME/folder/folder/.program \
screen -S test2 -d -m -X $HOME/folder/folder/.program2 \
Run Code Online (Sandbox Code Playgroud)
但是由于会话已经分离而无法执行命令?我唯一需要的是在屏幕会话中运行命令并立即分离此会话。
感谢您的回答,但现在我面临另一个问题。在我为“程序和程序 2”放置一些变量后,脚本停止工作。像这样的东西:
#!/bin/bash
screen -S test -d -m $HOME/folder/folder/.program -f config.cfg
Run Code Online (Sandbox Code Playgroud)
出于某种原因,“-f config.cfg”被忽略了。我也试图引用命令并且也没有帮助。
我在 gnome 终端上使用这个脚本:
#!/bin/sh
gnome-terminal --tab --title="1" --command="ssh 1" \
--tab --title="2" --command="ssh 2" \
--tab --title="3" --command="ssh 3" \
--tab --title="4" --command="ssh 4"
exit 0
Run Code Online (Sandbox Code Playgroud)
我如何通过脚本但在 Guake 终端上做同样的事情?
我在带有 4Gb RAM 和 300Gb HDD 的笔记本电脑上使用 ubuntu,我的布局是:
/ - 15Gb ext4 (4.5Gb used)
/home - 280Gb ext4 (200Gb used)
/swap - 2Gb
Run Code Online (Sandbox Code Playgroud)
我最近构建了一台带有 8Gb RAM 和 1Tb HDD 的 PC。现在我很好奇我应该如何分区我的硬盘,以便我双启动(Win7 + Ubuntu)。我刚在想:
boot - 200Mb
/ - 10Gb xfs
/home - 1000Gb xfs
ntfs - 200Gb
Run Code Online (Sandbox Code Playgroud)
没有交换,因为我根本不使用休眠。Ubuntu 将是主要系统,Win7 仅适用于一些无法在 Wine 上运行的新游戏。唯一的问题:
是否/boot
需要?
是XFS更好的/root
和/home
?
/home
这么大不是很糟糕吗?如果是的话,我应该做/usr
,
/var
,/tmp
还是别的什么?