Skip to content

Commit

Permalink
add and del
Browse files Browse the repository at this point in the history
  • Loading branch information
hs867785578 committed Aug 11, 2023
1 parent 87f37ad commit 02f347b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
1 change: 0 additions & 1 deletion docs/linux/ROS安装的坑.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/linux/source、bash、sh、.的区别.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export test=666
#查看一下此时shell进程的环境变量
env
```
# 1 source
## 1 source
source是在当前进程(终端)下执行脚本。source test.sh 等价于  . test.sh

执行这个命令时,**并非创建子进程**,test.sh内容是在当前的shell进程执行,即会在当前进程生效,执行之后,test.sh中env命令显示的是当前进程进程的环境变量,确实添加了 test=666。
Expand All @@ -17,7 +17,7 @@ source是在当前进程(终端)下执行脚本。source test.sh 等价于 
**用途**:给当前命令窗口进程,添加环境变量,比如Make的编译环境配置,可以通过命令一个一个变量添加,麻烦,一般都写在一个xxx.sh文件中,通过 source xxx.sh统一添加。xxx.sh不需要有”执行权限”


# 2 ./、sh、bash
## 2 ./、sh、bash

这三个命令都是新开一个子进程执行命令。(子进程可以继承父进程的环境变量,但是父进程看不到子进程的环境变量)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
wsl中由于权限问题,之前修改了usr目录的权限,导致sudo不能用了,解决方案如下
## wsl中由于权限问题,之前修改了usr目录的权限,导致sudo不能用了,解决方案如下
windows power shell中

```bash
ubuntu1804.exe config --default-user root

chown root:root /usr/bin/sudo
chmod 4755 /usr/bin/sudo
chown root /usr/lib/sudo/sudoers.so

ubuntu1804.exe config --default-user hanshuo
```

windows安装wsl2的教程
## windows安装wsl2的教程
https://zhuanlan.zhihu.com/p/356397851
windows11安装wslg

[如何在windows 11中安装WSLG(WSL2) - guojikun - 博客园 (cnblogs.com)](https://www.cnblogs.com/guojikun/p/15092696.html)

wsl2可视化
https://zhuanlan.zhihu.com/p/137618871
[wsl2可视化](https://zhuanlan.zhihu.com/p/137618871)

```bash
export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0
```

ros:

source /opt/ros/melodic/setup.bash

wsl2访问外网:
## wsl2访问外网:
1.首先保证wsl能访问本机ip
https://blog.csdn.net/nick_young_qu/article/details/113709768
![](images/ubuntu%20wsl的一些坑_image_1.png)
2.调整socket代理
![](images/ubuntu%20wsl的一些坑_image_2.png)

```
host_ip=$(cat /etc/resolv.conf |grep "nameserver" |cut -f 2 -d " ")
#export ALL_PROXY="http://$host_ip:10810"
export http_proxy=socks5://$host_ip:10810
export https_proxy=socks5://$host_ip:10810

```
如果遇到了socket报错,可以暂时先取消代理
```
unset http_proxy
unset https_proxy
```

cmake升级:
## cmake升级:
https://blog.csdn.net/qingkong8978/article/details/106432949
File renamed without changes.

0 comments on commit 02f347b

Please sign in to comment.