Make compatible with some old bash interpreters
Correct the `tldr: line 319: -1: substring expression < 0` error on some system with old bash.
This commit is contained in:
parent
b613f64c2a
commit
6c67c52179
2
tldr
2
tldr
|
@ -316,7 +316,7 @@ Display_tldr(){
|
||||||
'`') ((newfmt)) && Unlinted "Bad first character"
|
'`') ((newfmt)) && Unlinted "Bad first character"
|
||||||
((${#REPLY} <= 2)) && Unlinted "No valid code content"
|
((${#REPLY} <= 2)) && Unlinted "No valid code content"
|
||||||
[[ ! ${REPLY: -1} = '`' ]] && Unlinted "Code doesn't end in backtick"
|
[[ ! ${REPLY: -1} = '`' ]] && Unlinted "Code doesn't end in backtick"
|
||||||
val=${REPLY:1:-1}
|
val=${REPLY:1:${#REPLY}-1}
|
||||||
# Value: convert {{value}}
|
# Value: convert {{value}}
|
||||||
val=${val//\{\{/$CX$V}
|
val=${val//\{\{/$CX$V}
|
||||||
val=${val//\}\}/$XV$C}
|
val=${val//\}\}/$XV$C}
|
||||||
|
|
Loading…
Reference in New Issue