自己开发网站要多少钱,友汇网网站建设管理后台设置,网页策划方案模板范文,前端写一个页面多少钱大家好#xff0c;分享下最近工作中用得比较多的shell命令#xff0c;希望对大家有帮助。
获取数组长度#xff1a;
${#array_name[*]}获取脚本相对路径
script_path$(dirname $0)获取脚本的名字
script_name$(basename $0)获取脚本的绝对路径 … 大家好分享下最近工作中用得比较多的shell命令希望对大家有帮助。
获取数组长度
${#array_name[*]}获取脚本相对路径
script_path$(dirname $0)获取脚本的名字
script_name$(basename $0)获取脚本的绝对路径
script_path$(cd $(dirname $0) pwd)获取脚本的绝对文件路径
script_file_path$(cd $(dirname $0) pwd)/$(basename $0)获取后缀名字
testexample.txt
filename${test%.*}
suffix${test##*.}
echo $fileanme $suffix
## 输出example txt获取当前目录的最大序号的文件
ls | sort -n | tail -n 1 如
1.txt
2.txt
11.txt
22.txt
28.txt
33.txt
输出 33.txt单网卡配置多个ip 分别eth0网卡为两个ipeth0的虚拟网卡为eth0:0 eth0:1以此类推。
ifconfig eth0 192.168.1.100 netmask 255.255.255.0 up
route add default gw 192.168.1.1ifconfig eth0:0 192.168.2.100 netmask 255.255.255.0 up
route add default gw 192.168.2.1 dev eth0:0