仅以此代码为例。假设它是HTML /文本文件,如果我想知道出现的总次数,该echo
如何使用bash进行处理?
new_user()
{
echo "Preparing to add a new user..."
sleep 2
adduser # run the adduser program
}
echo "1. Add user"
echo "2. Exit"
echo "Enter your choice: "
read choice
case $choice in
1) new_user # call the new_user() function
;;
*) exit
;;
esac