1、cd $(dirname $0)   shell脚本里面添加这个命令就可以进入此sh目录下,不用写绝对路径

2、strMac=`ifconfig eth0 | grep "HWaddr" | awk '{print $5}'`   获取mac地址

3、strMacParse=${strMac//:/}   去掉字符串中的冒号:

4、ln -sfn XXX YYY   把XXX的软链接设置成YYY

5、截取双引号中的值,declare -x QT_IM_MODULE="fcitx",我要获取fctix,可以使用`echo $env | awk -F'"' '{print $2}'`

相关文章:

  • 2021-04-28
  • 2021-10-19
  • 2021-12-26
  • 2021-06-14
  • 2021-08-29
  • 2021-10-11
  • 2021-09-18
  • 2021-08-19
猜你喜欢
  • 2021-10-14
  • 2021-10-05
  • 2022-12-23
  • 2022-12-23
  • 2021-04-24
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案