Skip to content

Commit

Permalink
修改文章内容
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxwt committed Nov 7, 2021
1 parent 93686ee commit e6fe3a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions website/content/ChapterSix/NotNullargs.md
Expand Up @@ -32,21 +32,21 @@ echo ${foo#*.}

**${parameter##para}**
foo="file.txt.zip"
echo ${foo##*.}
echo ${foo##\*.}
输出结果 zip
该展开的意思是匹配开头的字符串清除,但是这个匹配可能会是多种情况,比如*.可以匹配成file.也可以匹配成file.txt.,但这里取最长的匹配项即file.txt

**${parameter%para}**
foo="file.txt.zip"
echo ${foo%.*}
echo ${foo%.\*}
输出结果 file.txt
该展开的意思是匹配末尾的字符串清除,但是这个匹配可能会是多种情况,比如.*,可以匹配成.zip,也可以匹配成.txt.zip,这里取最短的匹配项即.zip

**${parameter%%para}**
foo="file.txt.zip"
echo ${foo%%.*}
echo ${foo%%.\*}
输出结果 file
该展开的意思是匹配末尾的字符串清除,但是这个匹配可能会是多种情况,比如.*,可以匹配成.zip,也可以匹配成.txt.zip,这里取最短的匹配项即.txt.zip
该展开的意思是匹配末尾的字符串清除,但是这个匹配可能会是多种情况,比如.*,可以匹配成.zip,也可以匹配成.txt.zip,这里取最长的匹配项即.txt.zip

**${parameter/para/string}**
foo="JPGJPG"
Expand Down
2 changes: 1 addition & 1 deletion website/content/ChapterSix/Nullargs.md
Expand Up @@ -64,7 +64,7 @@ echo $foo

<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.linuxwt.com/linuxwtbash/ChapterSix/">⬅️上一页</a></p>
<p><a href="https://books.linuxwt.com/linuxwtbash/NotNullargs/">下一章➡️</a></p>
<p><a href="https://books.linuxwt.com/linuxwtbash/ChapterSix/NotNullargs/">下一章➡️</a></p>
</div>


Expand Down

0 comments on commit e6fe3a2

Please sign in to comment.