当前位置:网站首页>Shell Scripts相关
Shell Scripts相关
2022-07-27 07:43:00 【nginx】
- 获得变量长度
length = ${#var} - 识别root用户
#!/bin/bash
if [ $UID -ne 0 ]; then
echo "I'm not root"
else
echo "I'm root!"
fi - 数学运算
n1=4;
n2=5;
let result=n1+n2
echo $result
let不支持小数
bc用于数学计算的高级工具。
echo "sqrt(1.44)" | bc
echo "10^2" | bc
[email protected]:~/shellscripts$ echo "sqrt(1.44)" | bc
1.20
[email protected]:~/shellscripts$ echo "10^2" | bc
100
[email protected]:~/shellscripts$ echo "10^4" | bc
10000
边栏推荐
- Hu related configuration
- C language programming | program compilation and preprocessing
- [resolved] the new version of pychart (2022) connects to the server to upload files and reports an error of "command Rsync is not found in path", and the files cannot be synchronized
- shell awk相关练习
- 增强:BTE流程简介
- 【小程序】uniapp发行微信小程序上传失败Error: Error: {'errCode':-10008,'errMsg':'invalid ip...
- Use Amazon dynamodb and Amazon S3 combined with gzip compression to maximize the storage of player data
- OpenGL shader learning notes: varying variables
- 【小程序】如何获取微信小程序代码上传密钥?
- ADC噪声全面分析 -02- ADC 噪声测量方法和相关参数
猜你喜欢

mysql备份策略

ADC噪声全面分析 -01- ADC噪声的类型以及ADC特性

linux能不能安装sqlserver

Leetcode54. 螺旋矩阵

The integrated real-time HTAP database stonedb, how to replace MySQL and achieve nearly 100 times the improvement of analysis performance

An open source OA office automation system

剑指 Offer 58 - I. 翻转单词顺序

Demo submit a program and obtain ALV data of the program

ARP broadcasting practice cases

C#委托的使用案例
随机推荐
The first open source MySQL native HTAP database in China will be released soon! Look at the three highlights first, limited to the surrounding areas, waiting for you~
C# 中的转译字符'/b'
Comprehensive analysis of ADC noise-02-adc noise measurement method and related parameters
杂谈:手里有竿儿,肩上有网,至于背篓里有多少鱼真的重要吗?
安装tensorflow
电子量产项目框架--基本思想
RPC 远程过程调用
SQLite common function integration
User unlock sm04 sm12
ARP broadcasting practice cases
Shell loop exercise
Summary of several common ways to join dimension tables in Flink
Closed hash and open hash resolve hash conflicts
防止Cookie修改id欺骗登录
shell 函数和数组练习
小程序消息推送配置 Token校验失败,请检查确认
为啥国内大厂都把云计算当成香饽饽,这个万亿市场你真的了解吗
How to get DDL information of an object
Multi condition query of when
linux中mysql表名区不区分大小写