欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 科技 > IT业 > ubuntu22-安装vscode-配置shell命令环境-mac安装

ubuntu22-安装vscode-配置shell命令环境-mac安装

2025/5/8 22:47:32 来源:https://blog.csdn.net/m0_67316550/article/details/142460698  浏览:    关键词:ubuntu22-安装vscode-配置shell命令环境-mac安装

文章目录

  • 1.安装vscode
  • 2.修改语言为中文
  • 3.配置bash调试环境
    • 3.1.安装插件
    • 3.2.添加配置文件
  • 4.调试bash
    • 4.1.新建tmp.sh文件
    • 4.2.运行启动
  • 5.mac安装
  • 6.mac卸载

1.安装vscode

从官网下载安装包Code_1.93.1-1726079302_amd64.deb。
在ubuntu系统中,安装包所在目录打开命令行工具,输入:

udo dpkg -i code_1.93.1-1726079302_amd64.deb

中间点一个yes。
执行以下命令即可运行VS Code:

code

2.修改语言为中文

可以执行,相关文章。
https://plugin.blog.csdn.net/article/details/138569823

3.配置bash调试环境

3.1.安装插件

Bash Debug 调试插件
在这里插入图片描述
Shellman格式化插件
在这里插入图片描述
shellcheck 语法错误检查
shell-format 右键格式化文档
Code Runner 文档右键运行

3.2.添加配置文件

{"workbench.colorTheme": "Default Light Modern","launch": {"configurations": [{"type": "bashdb","request": "launch","terminalKind": "integrated" ,"name": "Bash-Debug (simplest configuration)","cwd": "${workspaceFolder}","program": "${file}","args": []}]}
}

4.调试bash

4.1.新建tmp.sh文件

编辑简单的待打印的内容

echo "1"
echo "2"
echo "3"

4.2.运行启动

调试运行。

5.mac安装

#!/bin/sh
CopyDirToDst() {# echo $1dirt=$1echo "$dirt"dirlan=$(ls "$dirt")echo "$dirlan"for file in $dirlan; dosrcfile=$dirt/$file/dstdir=$2/$fileecho "$srcfile" "$dstdir"# mkdir $dstdirif test -f "$file"; thenecho "file"else# 文件夹则复制到目标文件夹 存在则强制替换cp -R -f "$srcfile" "$dstdir"fidone
}
CopyDirToDst ./extension /home/zhiliao/Documents/test# sudo sh installmac.sh

6.mac卸载

#!/bin/sh
uninstall() {# echo $1dirt=$1echo "$dirt"dirlan=$(ls "$dirt")echo "$dirlan"for file in $dirlan; dosrcfile=$dirt/$file/strA=$filestrB="ZhiLiaoPlugins"result=$(echo "$strA" | grep "${strB}")# shellcheck disable=SC3010if [[ "$result" != "" ]]; thenecho "delete" "$srcfile"rm -R "$srcfile"fi        done
}
uninstall /home/zhiliao/Documents/test# sudo sh uninstallmac.sh

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com