Shell
1 人感兴趣 · 93 次引用
- 最新
- 推荐



Shell 的数组表示
数组中可以存放多个值。Bash Shell 只支持一维数组(不支持多维数组),初始化时不需要定义数组大小(与 PHP 类似)。

Shell 的参数传递
我们可以在执行 Shell 脚本时,向脚本传递参数,脚本内获取参数的格式为:$n。n 代表一个数字,1 为执行脚本的第一个参数,2 为执行脚本的第二个参数,以此类推……
linux 如何计算一个 shell 程序运行的时间
计算一个shell程序的运行时间,可以使用Linux系统提供的time命令进行计时。通过time命令,可以得到一个程序的运行时间信息,包括程序实际使用的时间、系统调用的时间以及程序的状态等等。
linux 如何设置一个环境变量,在 shell 退出之后也不会失效
在 Linux 中,定义环境变量最常见的方式是在 shell 中使用 export 命令。但是,这种方式定义的环境变量只在当前 shell 会话中有效。shell 退出之后,它们将不再可用。
Shell 脚本实战:Consul 服务注册和注销的最佳实践
这是一个 Bash 脚本,用于向 Consul 注册或注销服务。它包含许多变量和函数,可以通过命令行参数进行配置。

Shell 在日常工作中的应用实践
作为一名测试开发工程师,在与linux服务器交互过程中,大都遇到过许多问题,shell脚本小巧且功能强大,本篇文章给大家分享了些日常使用到的shell脚本,帮助我们提高工作效率

在 Linux 上有哪些运行程序的方式?
你是否想过,除了在 shell 下启动一个程序,是否还有其它的方式? 我们是不是永远无法摆脱 shell?

尝试阅读理解一份 linux shell 脚本
从头一二去阅读语法和命令说明,对于脚本小白来说比较枯燥,难以坚持,所以这里选择对一份完整的shell脚本代码来逐行逐段解读,希望可以一渡小白,帮助我们快速进入脚本的大门^_^。

2022-12-26:有一个数组包含 0、1、2 三种值, 有 m 次修改机会,第一种将所有连通的 1 变为 0,修改次数 -1, 第二种将所有连通的 2 变为 1 或 0,修改次数 -2, 返回 m 次修改机会的情况下,让最大的 0
2022-12-26:有一个数组包含0、1、2三种值,有m次修改机会,第一种将所有连通的1变为0,修改次数-1,第二种将所有连通的2变为1或0,修改次数-2,返回m次修改机会的情况下,让最大的0连通区,最长能是多少?1 <= arr长度 <= 10^6,0 <= 修改机会 <= 10^6。

2022-12-24:给定一个字符串 s,其中都是英文小写字母, 如果 s 中的子串含有的每种字符都是偶数个, 那么这样的子串就是达标子串,子串要求是连续串。 返回 s 中达标子串的最大长度。 1 <= s 的长
2022-12-24:给定一个字符串s,其中都是英文小写字母,如果s中的子串含有的每种字符都是偶数个,那么这样的子串就是达标子串,子串要求是连续串。返回s中达标子串的最大长度。1 <= s的长度 <= 10^5,字符种类都是英文小写。来自微软。

2022-11-10:写一个 bash 脚本以统计一个文本文件 words.txt 中每个单词出现的频率。 为了简单起见,你可以假设: words.txt 只包括小写字母和 ‘ ‘ 。 每个单词只由小写
2022-11-10:写一个 bash 脚本以统计一个文本文件 words.txt 中每个单词出现的频率。为了简单起见,你可以假设:words.txt只包括小写字母和 ' ' 。每个单词只由小写字母组成。单词间由一个或多个空格字符分隔。示例:假设 words.txt 内容如下:

在 Go 语言中使用 exec 包执行 Shell 命令
exec 是 os 包中的一个子包,它可用于使用 Go 运行外部命令。Go exec 命令教程展示了如何在 Golang 中执行 shell 命令和程序。

Shell 编程学习(二)
test是shell内置命令,用来检测某个条件是否成立test通常和if语句一起使用,并且大部分if语句都依赖test,shell test命令的用法有两种:

Shell 编程学习(一)
shell是一块包裹着系统核心的壳,处于操作系统的最外层,与用户直接对话,把用户的输入,解释给操作系统,然后处理操作系统的输出结果,输出到屏幕给予用户看到结果。
天翼云 Web 应用防火墙(边缘云版)支持检测和拦截 Apache Spark shell 命令注入漏洞
Apache Spark是美国阿帕奇(Apache)软件基金会的一款支持非循环数据流和内存计算的大规模数据处理引擎, 如果Apache Spark UI启用了 ACL,则HttpSecurityFilter 中的代码路径允许通过提供任意用户名来模拟执行。

