shell的${}使用
来源:互联网 发布:网络斗牛公式编程原理 编辑:程序博客网 时间:2024/06/06 13:08
${param:-default} If param is null, then set it to the value of default .
${#param} Gives the length of param
${param%word} From the end, removes the smallest part of param that
matches word and returns the rest
${param%%word} From the end, removes the longest part of param that
matches word and returns the rest
${param#word} From the beginning, removes the smallest part of param that
matches word and returns the rest
${param##word} From the beginning, removes the longest part of param that
matches word and returns the rest
=========================================================
unset foo
echo ${foo:-bar}
output:bar
-----------------------------------
foo=fudecho ${foo:-bar}
output:fud
--------------------------------------
foo=/usr/bin/X11/startxecho ${foo#*/}
echo ${foo##*/}
output: usr/bin/X11/startx
startx
--------------------------------------------
bar=/usr/local/etc/local/networks
echo ${bar%local*}echo ${bar%%local*}
output: /usr/local/etc
/usr
- shell 的使用体会
- shell 函数的使用
- Shell 循环的使用
- shell 脚本的使用
- HBASE的shell使用
- shell shift的使用
- shell的使用
- shell “(())”的使用
- Shell变量的使用
- shell test的使用
- shell---数组的使用
- shell if的使用
- MongoDB Shell的使用
- shell数组的使用
- linux shell的使用
- shell中的${},##, %% , :- ,:+, ? 的使用
- shell函数的使用
- sqlite3 shell的使用
- S7200目录
- class.getResource("XXX").getPath()返回路径空格变成了 异常解决
- Spark1.5堆内存分配
- 【Java笔记】网络编程基础
- Unity自定义UI组件(一)函数图篇(上)
- shell的${}使用
- git忽略文件
- 简单选择排序
- 【css3】过渡
- Java之注解(Annotation)
- 廖雪峰《Python3 基础教程》读书笔记——第三章
- android Vibrator开启振动功能
- 获取广播地址
- HDU 3466 Proud Merchants (01背包排序问题)