Increased Security
This commit is contained in:
@@ -118,7 +118,7 @@ jobs:
|
|||||||
local length=${#input} # 计算输入字符串的长度并赋值给局部变量 length
|
local length=${#input} # 计算输入字符串的长度并赋值给局部变量 length
|
||||||
|
|
||||||
# 如果字符串长度小于等于2,则将其全部替换为 '*'
|
# 如果字符串长度小于等于2,则将其全部替换为 '*'
|
||||||
if [ $length -le 2 ]; then
|
if [ $length -le 3 ]; then
|
||||||
echo $(printf '%*s' $length | tr ' ' '*') # 使用 printf 和 tr 命令生成与长度相同数量的 '*'
|
echo $(printf '%*s' $length | tr ' ' '*') # 使用 printf 和 tr 命令生成与长度相同数量的 '*'
|
||||||
else
|
else
|
||||||
local first=${input:0:1} # 提取字符串的第一个字符并赋值给局部变量 first
|
local first=${input:0:1} # 提取字符串的第一个字符并赋值给局部变量 first
|
||||||
|
|||||||
Reference in New Issue
Block a user