小编joh*_*345的帖子

如果输入为是,则获取脚本以再次运行

我正在整理一个简单的文件处理脚本,除了最后,它一切正常,我想说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)

shell shell-script

5
推荐指数
2
解决办法
1万
查看次数

找到我可以读写的文件数量

如何计算给定目录中当前用户具有读权限和写权限的文件数?

我从:

echo "whats the directory you want to check ?"
read dir
Run Code Online (Sandbox Code Playgroud)

不确定我应该使用find命令吗?

shell bash shell-script

1
推荐指数
1
解决办法
2285
查看次数

标签 统计

shell ×2

shell-script ×2

bash ×1