| |

VerySource

 Forgot password?
 Register
Search
View: 782|Reply: 1

Take a look at this programming topic! !! !! !!

[Copy link]

5

Threads

14

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-1-7 19:00:01
| Show all posts |Read mode
Write a shell script to check the items of a designated directory which must be input from your terminal: if the item is a directory, delete it; else print the name of this item.
Reply

Use magic Report

0

Threads

23

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

Post time: 2020-1-9 15:36:01
| Show all posts
#! / bin / sh
echo "read directory name:"
read Ddir
if [-d $ Ddir]; then
echo "$ {Ddir} is exists"
if [-w $ Ddir]; then
rm -rf $ Ddir
echo "Remove completed!"
else
echo "You don't have the permission to remove it!"
fi
Ranch
else
echo "The directory $ {Ddir} is not exists!"
fi
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list