Shell Script
Contents
Shell Script#
sh, bash, zsh and so on#
- date
2020-12-26
- version
1
String#
Get length:
${#str}
Substring / Slice:
${str:1:4}
Replace:
${v%.md}.rst
Heredoc#
Syntax:
cat <<EOF
... Heredoc content
EOF
备注
Shell variables in heredoc will be expanded
Avoid shell expanding variables:
cat <<'EOF'
... Heredoc ${content}
EOF
Command Line Arguments#
Number of pass-in arguments:
$#
The “pass-in argument list:
$* # Default, an *array*
$@ # Default, a *string*
The arguments of previous command:
!^ # First one
!$ # Last one
!* # All
!:n # N-th
!:n-m # Range n~m
评论
如果你有任何意见,请在此评论。 如果你留下了电子邮箱,我可能会通过 回复你。