[root@localhost user]# cat untar.sh
#!/bin/bash
case $1 in
*.tar)
tar -xvf $1
if [ $? = 0 ]
then
echo "untar seccess"
else
echo "untar failed"
fi
;;
*)
echo "null"
esac
[root@localhost user]# sh untar.sh users.tar
users.txt
untar seccess
shell-case语句
最新推荐文章于 2024-06-04 13:54:19 发布