Add a couple of questions
This commit is contained in:
20
exercises/shell/solutions/empty_files.md
Normal file
20
exercises/shell/solutions/empty_files.md
Normal file
@ -0,0 +1,20 @@
|
||||
## Empty Files
|
||||
|
||||
### Objectives
|
||||
|
||||
1. Write a script to remove all the empty files in a given directory (including nested directories)
|
||||
|
||||
### Solution
|
||||
|
||||
```
|
||||
#! /bin/bash
|
||||
for x in *
|
||||
do
|
||||
if [ -s $x ]
|
||||
then
|
||||
continue
|
||||
else
|
||||
rm -rf $x
|
||||
fi
|
||||
done
|
||||
```
|
Reference in New Issue
Block a user