我正在整理一个简单的文件处理脚本,除了最后,它一切正常,我想说do you want to perform another action,如果答案是,yes那么我希望脚本重新启动。我知道我需要某种循环吗?这是我所拥有的:
#/bin/bash
echo "Select an option from copy , remove , rename , linking"
#read in user input into the action variable
read action
# if action is copy then continue proceed with the following
if [ $action = "copy" ]
then
echo "Please enter the filename you wish to copy"
read filename
# check if filename exists, if it doesn't then exit program
if [ ! -e $filename ] …Run Code Online (Sandbox Code Playgroud) 如何计算给定目录中当前用户具有读权限和写权限的文件数?
我从:
echo "whats the directory you want to check ?"
read dir
Run Code Online (Sandbox Code Playgroud)
不确定我应该使用find命令吗?