Shell注释

Shell脚本 注释 以"#"开头的行就是注释,会被解释器忽略。(除第一行的解释器以外) shell里没有多行注释,只能每一行加一个#号。 #!/bin/bash #################################### #################################### ## ## this is my first shell script ## ... 阅读详情
以“#”开头的行就是注释,会被解释器忽略。

sh里没有多行注释,只能每一行加一个#号。

如果在开发过程中,遇到大段的代码需要临时注释起来,过一会儿又取消注释,怎么办呢?每一行加个#符号太费力了,可以把这一段要注释的代码用一对花括号括起来,定义成一个函数,没有地方调用这个函数,这块代码就不会执行,达到了和注释一样的效果。

Android开发必备:Shell 脚本语法基础 Shell脚本是Android开发中提升效率的重要工具,可用于自动化编译、设备调试和日志分析等场景。文章系统介绍了Shell脚本的核心语法:1.基础认知,包括脚本创建和执行方式;2.变量定义与使用规则,包括作用域和环境变量;3.运算符使用,涵盖算术、比较和逻辑运算;4.流程控制结构,如条件判断和循环;5.函数封装,实现代码复用。掌握这些语法后,开发者可编写实用脚本,如自动打包和测试平台上传脚本,并可通过文本处理命令进一步优化日志分析等复杂任务。 阅读详情

相关推荐

Android11 关于三方应用获取su权限

SELinux,全称Security-Enhanced Linux,是一种基于Linux内核的安全机制。它通过强制访问控制(MAC)来增强Linux系统的安全性,如果不禁用SELinux,完成下面的修改可能会导致设备进入Recovery界面!adb shell getenforce 为Permissive(宽容模式),查看报错日志,发现是客户apk想使用su命令提权,但是没有权限!对于保护系统资源和防止未经授权访问非常有帮助!系统这边做修改,让su权限下放到三方应用.客户的apk运行报错。

sinat_37429535的博客 1901

shell脚本注释方法

shell脚本注释 shell脚本的注释分两种:单行注释和多行注释 1.单行注释 单行注释众所周知,在语句行的首个位置添加 ‘#’ 键 [root@localhost ~]# cat hello.sh #!/bin/bash ######################################### # File Name: hello.sh # Version: v1.0 # Author:wkk # Organization:NULL #############################

weixin_54956275的博客 2万+

Halcon像素比例标定(误差大)-相机标定

一种简易标定: 像素比例标定,如果需要精确一些则需要在高度和宽度上都需要计算,然后求出比例系数。需要高精度标定板和相机,以及多次标定才能达到稳定的状态,这种标定简单,但是误差大。 read_image (Img0008, 'D:/00项目代码/000视觉软件/02Halocn算法20190501/04测量20190424/07_比例计算测量标定/IMG0008.jpg') rgb1_to_...

SSSS的博客 3984

如何在sh文件添加整段注释

如果是大段注释,可以借助文本编辑器(如 VS Code、Nano、Vim 等)实现快速注释。例如,在 VS Code 中选中多行后按 Ctrl+/ 会自动为每行加上 #。

2302_81456999的博客 1491

Qt加载百度地图详细流程(附带报错解决方法)

一篇文章看懂Qt如何加载出百度地图......

qq_60018273的博客 1604

从3D相机数据到三维模型:Halcon实战深度图、亮度图与点云转换全流程

本文详细解析了如何利用Halcon将3D相机采集的深度图、亮度图转换为三维点云模型的完整流程。通过实战案例分享,涵盖数据格式处理、点云生成方法(SDK接口与纯Halcon实现)、三维模型可视化优化等关键技术,帮助工程师解决工业检测中的实际难题,提升三维重建精度与效率。

weixin_42525005的博客 394

linux脚本编写基础之珍藏

经过长时间学习Linux脚本编写的用法,于是和大家分享一下,看完本文你肯定有不少收获,希望本文能教会你更多东西。Linux脚本编写语法基础介绍: 1 开头程序必须以下面的行开始(必须方在文件的第一行):#!/bin/sh符号#!用来告诉系统它后面的参数是用来执行该文件的程序。在这个例子中我们使用/bin/sh来执行程序。当编写脚本完成时,如果要执行该脚本,还必须使其可执行。要使编写脚本可执行...

希望不是无解 1666

iStoreOS等软路由插件卸载的残留?分享一款软路由高级卸载工具,自定义卸载,轻松解决卸载残留问题

iStoreOS用户看过来!👀 还在被插件包残留困扰吗?本文分享一款“高级卸载”的插件,助你深度清理iStoreOS系统,彻底解决软件卸载不净的痛点,告别频繁恢复出厂设置的烦恼!🚀

XiaoqiangClub的博客 1537

shell脚本——注释(单行注释 多行注释)

单行注释以"#"开头的行就是注释,会被解释器忽略。#-------------------------------------------- # 这是一个注释 # author:菜鸟教程 # site:www.runoob.com # slogan:学的不仅是技术,更是梦想! #-------------------------------------------- ##### 用户配置区 开始 ...

杰儿__er 的博客 14万+

修改yolov8使支持单通道图像输入

默认支持BGR三通道图像输入,但是在很多工业场景下,存在很多灰度图像的场景,因此对yolov8代码做一些修改以支持单通道图像输入,满足项目实际需求。训练时,只需要在 data 的 yaml 文件中,添加 ch=1 即可。

mingo_敏 5779

Camera HAL 多线程管理详解

本文摘要:Camera HAL 采用双线程管理体系(CAMX与CHI-CDK)实现高效并发处理。CAMX ThreadManager负责HAL内部及框架交互,采用线程池+任务调度机制,将节点处理、回调等封装为Job异步执行;CHI ThreadManager专注于OEM定制逻辑,支持异步/同步两种作业模式。两套系统通过函数指针解耦但共享地址空间,共同实现硬件流水线的强实时性。文章详细解析了两者的类层次架构、核心数据结构及典型应用场景,并提供了问题排查的代码切入点,为Camera HAL开发与性能优化提供指导

DU_YULIN的博客 55

shell脚本中的多行注释

shell 中注释的使用方法 1、 单行注释 单行注释最为常见,它是通过一个‘#’来实现的。注意shell脚本的最开始部分“#!/bin/bash”的#号不是用来注释的。 2、 多行注释 在shell脚本中还有一种多行的注释方法,我们称之为"HERE DOCUMENT"的特性。格式如下: <<xxxx comment 1 comment 2 啊啊啊啊 xxxx 其中xxxx可...

遇见你是我最美丽的意外 2万+

安装 miniconda linux

安装 miniconda linux

jacke121的专栏 1万+

Shell脚本注释

文章目录单行注释多行注释/段注释一、空命令 `:` 和 追加输入重定向 `<<`解决注释中有反引号的问题方法一方法二方法三方法四方法五二、空命令 `:` 和 if...then.. 语句三、空命令 `:` 和单引号 `'` 单行注释 直接在行最前端加上符号 # 即可。具体用法如下所示: # this is comment test echo "this is comment test" 多行注释/段注释 一、空命令 : 和 追加输入重定向 << :<<BLOCK ..

liaowenxiong的博客 5035

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

4.shell数组、shell注释

Shell数组 bash支持一维数组(不支持多维数组),并且没有限定数组的大小。 类似于 C 语言,数组元素的下标由 0 开始编号。获取数组中的元素要利用下标,下标可以是整数或算术表达式,其值应大于或等于 0。 1.shell数组如何定义 在 Shell 中,用括号来表示数组,数组元素用"空格"符号分割开。定义数组的一般形式为 数组名=(值1 值2 ...

扛麻袋的少年的博客 1342

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

shell中如何批量注释和取消注释

shell中如何批量注释和取消注释 更新时间:2020年08月27日 11:14:36 作者:用户1214487 这篇文章主要介绍了shell中如何批量注释和取消注释,帮助大家更好的理解和学习shell脚本,感兴趣的朋友可以了解下 1 2 3 4 5 6 7 #!/bin/bash echo "1" echo "2" echo "3" echo "4" echo "5" ...

shi_xin的专栏 3174

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

Shell编程——Shell脚本的注释(用#来行注释)

关于Shell脚本如何注释,了解以下三点内容即可。

主要记录嵌入式学习与开发过程。 4597

shell 多行注释

在写 shell 脚本的时候,经常需要注释多行命令,但在每一行前输入 # ,很不方便。 1、DOCUMENT 可以采用 HERE DOCUMENT 特性,实现多行注释,这是比较稳妥的作法 比如: #!/bin/bash <<'COMMENT' your comment 1 your comment 2 ... COMMENT 2、直接采用 : ' 直接采用 : '这个命令的特殊作用,但这种做法有很多局限性,而且会影响性能。 注意: + 空格 + 单引号。 如下是最简单的使用方

Rnan_prince的博客 8614

shell的多行注释

https://zhuanlan.zhihu.com/p/54494213 Shell 语言中是没有类似于 C/C++, Python 等计算机语言多行注释的功能的,可是对于脚本文件进行调试时,我们不可避免的需要对其中的代码进行注释,如果是很少的几行代码,手动的在每行首添加 # 就可以了,但是如果需要对于大量的代码块进行注释,手动的注释每行代码就不适用了。对于这个问题,推荐一些常用的方法。 第一种方法(利用 Here Document 特性): 简单来说就是用一个空命令接收要注释的命令行,不做任何事情,以此

wgz7747147820的博客 747

shell批量注释

单行注释用#,如果要把一段代码全部注释掉,可以用如下方法 ########################代码分隔线######################## ...非注释的内容 :MULTILINECOMMENT ...注释的内容 ...注释的内容 MULTILINECOMMENT ...非注释的内容 ########################代码分隔线#####

大爱无疆的博客 1947

shell 中的单行注释和多行注释

1. 单行注释 众所周知,#  比如想要注释:echo “ni” # echo "ni"   2. 多行注释: 法一: : 语句1 语句2 语句3 语句4 ! 例如: linux101:/home/wsj # sh dian ni ni ni ni ni ni linux101:/home/wsj # more dian #!/bin/ksh echo

lansesl2008的专栏 27万+

Linux:shell 中的单行注释和多行注释

Linux:shell 中的单行注释和多行注释

hhd1988的专栏 1万+

shell 多行注释详解

在我们写 shell 脚本的时候,特别在调试的时候经常需要注释多行命令,但在每一行前输入 # ,显得有些麻烦。 基于 shell 命令的灵活性,我们可以使用下面的方法: 方法一(这是比较稳妥的作法):可以采用 HERE DOCUMENT 特性,实现多行注释,比如 <<'COMMENT' ... COMMENT 举例如下: #!/bin/b...

dengji8846的博客 2796

shell脚本的注释方法

1. 单行注释 众所周知,# 比如想要注释:echo “ni” # echo "ni" 2. 多行注释: 法一: : << ! 语句1 语句2 语句3 语句4 ! 例如: linux101:/home/wsj # sh dian ni ni ni ni ni ni linux101:/home/wsj # more dian #!/bin/ksh echo "ni

qq_24352593的专栏 1012

linux脚本怎么注释,Shell脚本注释写法

一、单选注释以“#”开头的行就是注释,会被解释器忽略。#--------------------------------------------# 这是一个自动打ipa的脚本,基于webfrogs的ipa-build书写:# https://github.com/webfrogs/xcode_shell/blob/master/ipa-build# 功能:自动为etao ios app打包,产出物...

weixin_28902749的博客 2971
上一篇: Shell运算符:Shell算数运算符、关系运算符、布尔运算符、字符串运算符等
下一篇: Shell字符串
puyangdev
博客等级 码龄10年 10粉丝 77原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值