Linux shell `#!` interpreter All In One
1.Linux shell command ln All In One2.Linux shell command cut All In One3.Linux shell standard input bugs All In One4.Linux shell command base64 All In One5.How to use the shell command to get the version of Linux Distributions All In One6.Linux shell command make & Makefile All In One7.Linux shell command strings All In One8.sudo & su & Rust All In One9.Linux shell command make All In One10.Linux shell script shebang env All In One11.Linux shell script switch...case All In One12.Linux shell command ls sort by date All In One13.Linux shell script read file line by line All In One14.Linux shell regular expression All In One15.How to fix IP filter regular expressions written using grep command in Linux shell script All In One16.Linux shell script programming All In One17.Linux shell script redirection All In One18.How to use Linux shell command filter the IP address All In One19.how to create one interactive mode command line configuration tool with shell language on Linux All In One20.Linux shell script get date and time All In One21.Linux shell command screen All In One
22.Linux shell `#!` interpreter All In One
23.Linux shell set command All In One24.Linux shell script auto generate batch files All In One25.Linux bash script HereDoc All In One26.Linux shell system environment variables All In One27.Linux shell command curl All In One28.Linux shell command chroot All In One29.Linux shell command chmod All In One30.Linux shell number variables add All In One31.Linux bash shell "${1}" All In One32.Linux xattr shell command All In One33.Multiple Ways to Change Terminal Shell in Linux All In One34.Linux shell stdin & stdout & stderr All In One35.Linux shell man command All In One36.Linux shell command line editor All In One37.Linux shell command uname All In One38.Linux bash shell script block comment All In One39.Linux bash shell script batch download files All In One40.Linux shell script bug and error All In One41.Linux bash write long string with multi-lines comments All In One42.Linux set command All In One43.Linux echo command All In One44.Linux echo 换行 All In One45.Linux Bash shell 脚本定时器 All In One46.Linux System Variables All In One47.linux bash shell auto read write template48.Linux bash script read args All In One49.Linux Bash Script conditions syntax All In One50.Linux Bash Script loop syntax All In One51.Linux shell script All In One52.如何通过 Linux terminal 查看一个文件的 meta 信息 All In One53.Linux shell uname -a All In One54.Linux shell command create file methods All In One55. how to write string to file in linux bash All In One56.linux bash shell & lsof & grep & ps57.Linux Bash Shell All In One58.Linux shell command copy file All In One59.Linux shell command & zip & tar All In One60.Linux shell command show project directory tree All In One61.Linux shell commands man chmod All In One62.Linux & bash & shell & PID & PPID63.Linux bash shell All In One64.Linux shell command symbolic link & soft link All In One65.Linux bash shell All In One66.Linux shell (.sh 文件) 基础命令 常用命令 汇总67.How to use a shell script to check whether a command had been installed in the Linux server All In One68.How to print a string with a variable by using the echo command in the shell script All In One69.Linux install vim errors All In One70.Raspberry Pi 设置开机登录后自启动脚本 All In OneLinux shell #!
interpreter All In One
指定脚本
解释器
的路径
Python
Python 3
#!/usr/bin/env python3
# ✅ 推荐写法, 动态读取 env 配置的解释器路径,切换系统环境不会报错,可移植性高 🚀
#!/usr/bin/python3
# 👎 不推荐写法,写死了解释器路径,切换系统环境有可能会报错,可移植性低
https://www.runoob.com/python3/python3-tutorial.html
GPIO
#!/usr/bin/env python3
# coding: utf8
import RPi.GPIO as GPIO
import time
import sys
arg1 = sys.argv[1]
print("arg1 =", arg1);
# 指定 BCM 模式下的GPIO 针脚编号
PIN = 12
# BCM 模式
GPIO.setmode(GPIO.BCM)
# 指定 GPIO 针脚为一个电流输出针脚
GPIO.setup(PIN, GPIO.OUT)
# 输出低电平
GPIO.output(PIN, GPIO.LOW)
# index
i = 0
# max
# n = 7
# 类型转换,str => int
n = int(arg1)
print("n =", n)
print('开始闪烁⏳')
while (i < n):
print("i =", i)
# 高电平,LED 点亮
GPIO.output(PIN, GPIO.HIGH)
# 休眠 1 秒,防止 LED 长时间点亮烧坏了
time.sleep(1.0)
# 低电平,LED 熄灭
GPIO.output(PIN, GPIO.LOW)
# 休眠 1 秒
time.sleep(1.0)
i = i + 1
# 输出低电平,LED 关闭
# GPIO.output(PIN, GPIO.LOW)
# 清除,释放内存
GPIO.cleanup()
print('结束闪烁 👌🏻')
Node.js CLI
#!/usr/bin/env node
# ✅ 推荐写法, 动态读取 env 配置的解释器路径,切换系统环境不会报错,可移植性高 🚀
#!/usr/bin/node
# 👎 不推荐写法,写死了解释器路径,切换系统环境有可能会报错,可移植性低
cli
#!/usr/bin/env node
/**
* [nct : node cli tools]
* @author: xgqfrms
* @date: 2017-06-12
*/
const nct = require('./libs');
const username = process.argv[2] || `xgqfrms-GitHub`;
const repo = process.argv[3] || `Node-CLI-Tools`;
nct(username, repo);
https://github.com/xgqfrms-GitHub/Node-CLI-Tools
https://node-cli-tools.xgqfrms.xyz/
refs
©xgqfrms 2012-2021
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/17273683.html
未经授权禁止转载,违者必究!
合集:
Linux Shell
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
2022-03-30 React Animation All In One
2022-03-30 TypeScript namespace All In One
2022-03-30 macOS Monterey 12.3 All In One
2021-03-30 uni-app & nvue & cli
2021-03-30 如何使用 Apple Watch 上 NFC 功能复制门禁卡 All In One
2020-03-30 @bind decorator
2020-03-30 TypeScript & global.d.ts All In One