gpt4 book ai didi

bash - Cygwin 启动脚本

转载 作者:行者123 更新时间:2023-11-29 08:49:08 24 4
gpt4 key购买 nike

如何在 cygwin 启动后在其中运行脚本?

我想在 cygwin 启动时自动添加一些挂载并运行其他脚本。我看到在 linux 中它就像在 etc/init.d 中添加一个 shell 文件一样简单但是,我尝试添加此目录并 chmod +x 添加一个 shell,chmod 那个 shell 文件,但不起作用。

此外,如果有一种方法可以在关闭时运行脚本,如 umount、rmdir 等。

最佳答案

你要找的是

~/.bash_profile

又名

C:\cygwin\home\CPJ\.bash_profile

在 stock 安装中,这个文件在 Cygwin 启动时被读取。例如,如果您想添加更多文件,您可以编辑 .bash_profile 文件

source foo.sh
source bar.sh
source baz.sh

Bash man page

关于bash - Cygwin 启动脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15325137/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com