sh - 每次在 Windows 10 上打开 WSL Ubuntu 18.04 时,我都需要运行一个脚本
问题描述
每次我在 Windows 10 上打开 WSL Ubuntu 18.04 时,我都想自动运行这些设置。
alias desktop='cd /mnt/c/Users/Dot/Desktop/ai_files'
export PYTHONPATH=${PYTHONPATH}:${HOME}/ai-safety-gridworlds
export DISPLAY=localhost:0.0
我尝试在 /etc/init.d/ 中使用以下内容制作 .sh 脚本,但没有成功。
#!/bin/bash
alias desktop='cd /mnt/c/Users/Dot/Desktop/ai_files'
export PYTHONPATH=${PYTHONPATH}:${HOME}/ai-safety-gridworlds
export DISPLAY=localhost:0.0
解决方案
推荐阅读
- javascript - 如何在使用之前在 JavaScript (ES5) 中强制声明函数构造函数属性?
- xamarin - Xamarin Forms 中是否有任何方法可以更改对话框的背景颜色?
- unity3d - 无图层和剔除蒙版
- c# - Asp.Net Razor 页面处理程序未正确调用方法 C#
- php - Composer 包在哪里放置客户端配置?
- python - 有什么有效的方法可以循环遍历带有其值列表的列以在熊猫中进行条件过滤?
- javascript - amCharts 中 x 轴上的标签缺失
- xamarin - 使用带有 XF 的 ZXingScannerPage,我的内容页面有奇怪的行为
- c# - 如何在 c# 中替换 IndexOutOfRangeException 错误并改用 BadRequest()?
- r - 在R中评估非常大的阶乘