반응형
Backup & Recovery Shell Script를 만들다가, Progress Bar를 구현해봤습니다.
#!/bin/bash
echo "##############################"
echo " Backup & Recovery Shell"
echo "##############################"
date
read num
if [ $num == 1 ]
then
echo "------------------"
echo "Backup Starting "
echo "------------------"
echo -ne "[# ]\r"
sleep 1
echo -ne "[##### ]\r"
sleep 1
echo -ne "[########## ]\r"
sleep 1
echo -ne "[############### ]\r"
sleep 1
echo -ne "[#####################]\r"
sleep 1
echo -e "\n"
echo "Backup Complete!!!"
elif [ $num == 2 ]
then
echo "------------------"
echo "Recovery Starting"
echo "------------------"
echo -ne "[# ]\r"
sleep 1
echo -ne "[##### ]\r"
sleep 1
echo -ne "[########## ]\r"
sleep 1
echo -ne "[############### ]\r"
sleep 1
echo -ne "[#####################]\r"
sleep 1
echo -e "\n"
echo "Recovery Complete!!!"
else
echo "Please Typed Correct Number"
echo "#######None Action########"
fi
반응형
'Command & Development > Shell Script' 카테고리의 다른 글
[Shell Script] Linux 설치 후 초기 설정 (0) | 2023.01.31 |
---|---|
[Shell Script] Ubuntu Shell Script : unexpected operator (0) | 2022.11.16 |
[Shell Script] Calculator (0) | 2022.09.20 |
[Shell Script] 사용자 입력받기 (0) | 2022.09.20 |
[Shell Script] sshpass 접속 검증 (0) | 2022.09.06 |