当前位置:网站首页>Shell scripts related
Shell scripts related
2022-07-27 07:54:00 【nginx】
- Get variable length
length = ${#var} - distinguish root user
#!/bin/bash
if [ $UID -ne 0 ]; then
echo "I'm not root"
else
echo "I'm root!"
fi - Mathematical operations
n1=4;
n2=5;
let result=n1+n2
echo $result
let Decimals... Are not supported
bc Advanced tools for mathematical calculations .
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
边栏推荐
- 正则 和 sed 练习
- Demo:pa30 Bank Country Code default CN enhancement
- 擎创科技加入龙蜥社区,共建智能运维平台新生态
- QingChuang technology joined dragon lizard community to build a new ecosystem of intelligent operation and maintenance platform
- 抽象工厂模式
- IDEA中文乱码怎么办
- 物联网工业级UART串口转WiFi转有线网口转以太网网关WiFi模块选型
- Convert objects to key value pairs
- npm的使用
- Combined use of C WinForm form form event and delegate
猜你喜欢

Combined use of C WinForm form form event and delegate

杂谈:手里有竿儿,肩上有网,至于背篓里有多少鱼真的重要吗?

这次龙蜥展区玩的新花样,看看是谁的 DNA 动了?

综合案例、
![[resolved] the new version of pychart (2022) connects to the server to upload files and reports an error of](/img/13/573d8ae55eb25580a5628b469dfab3.png)
[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

物联网工业级UART串口转WiFi转有线网口转以太网网关WiFi模块选型

Promise详解

小程序支付管理-新版支付对接流程

Lua迭代器

【StoneDB Class】入门第一课:数据库知识科普
随机推荐
Stored procedures and functions
C语言:随机生成数+插入排序
Solution to automatic disconnection of SSH link of Tencent ECS
Harbor can't log in with the correct password
C event usage case subscription event+=
[golang learning notes 2.1] sorting and searching in arrays in golang
yhb_ sysbench
kalibr标定realsenseD435i --多相机标定
Debug:与泛型有关的“无法解析的外部符号”
Zero training platform course-1. SQL injection Foundation
小程序支付管理-新版支付对接流程
【飞控开发基础教程4】疯壳·开源编队无人机-串口(光流数据获取)
Apifox安装及使用
Practical new drug R & D project management platform
大家节日快乐哈
DEMO SUBMIT 某程序并获取该程序ALV数据
Installation and use of apifox
小程序消息推送配置 Token校验失败,请检查确认
shell awk相关练习
【pytorch】ResNet18、ResNet20、ResNet34、ResNet50网络结构与实现