test 判断字符串不为空

作者 : admin 本文共94个字,预计阅读时间需要1分钟 发布时间: 2024-06-10 共1人阅读

#!/bin/bash

read -p “请输入参数:” name

test -z $name

if [ $? -eq 1 ];
then
   echo “入参:$name”
else
   echo “入参为null”
fi

test 判断字符串不为空插图 

test 判断字符串不为空插图(1) test 判断字符串不为空插图(2)

本站无任何商业行为
个人在线分享 » test 判断字符串不为空
E-->