vscode configures shell script, runs shell script on window
- Set the git-bash language file to a file with a .sh suffix to match the .sh file.
- Set the default processor of the command line shell to bash.exe, which is used to parse .sh files on the command line.
"code-runner.languageIdToFileExtensionMap": {
"bat": ".bat",
"powershell": ".ps1",
"typescript": ".ts",
"git-bash": ".sh"
},
"terminal.integrated.shell.windows": "D:\\soft\\Git\\bin\\bash.exe",
The bottom line is the address of bash, not git-bash.
write shell
#!/bin/bash
your_name="黑胡椒"
echo $your_name
echo ${your_name}
str1='test'
str2="demo"
echo $str1 $str2
echo ${#str1}
echo ${str1:1:3}
for((i=0;i<3;i++));
do
echo $i
done