当前位置:网站首页>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
边栏推荐
- Zero training platform course-1. SQL injection Foundation
- Grandson's questions are difficult, and his son's invigilation is strict. I can't do it. Pay back my school money
- Regular and sed exercises
- Harbor正确密码登录不上去
- SQL labs SQL injection platform - level 1 less-1 get - error based - Single Quotes - string (get single quote character injection based on errors)
- 模仿大佬制作的宿舍门禁系统(三)
- 为啥国内大厂都把云计算当成香饽饽,这个万亿市场你真的了解吗
- Happy holidays, everyone
- kalibr标定realsenseD435i --多相机标定
- Jjwt generate token
猜你喜欢
随机推荐
C commissioned use cases
QingChuang technology joined dragon lizard community to build a new ecosystem of intelligent operation and maintenance platform
glGetUniformLocation,glUniform4f
Happy holidays, everyone
What are the main threads of Youxuan database?
鲁迅:我不记得说没说过,要不你自己查!
Day111. Shangyitong: integrate nuxt framework, front page data, hospital details page
Shell awk related exercises
Do me a favor ~ don't pay attention, don't log in, a questionnaire in less than a minute
一体化实时HTAP数据库StoneDB,如何替换MySQL并实现近百倍分析性能的提升
The integrated real-time HTAP database stonedb, how to replace MySQL and achieve nearly 100 times the improvement of analysis performance
如何在 60 秒内去分析和定位问题?
【已解决】单点登录成功SSO转发,转发URL中带参数导致报错There was an unexpected error (type=Internal Server Error, status=500)
面试复盘五
Debug:与泛型有关的“无法解析的外部符号”
防止Cookie修改id欺骗登录
Lu Xun: I don't remember saying it, or you can check it yourself!
孙子出题难,儿子监考严。老子不会做,还我上学钱
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~









