2
rated 0 times
[
2]
[
0]
/ answers: 1 / hits: 1297
/ 2 Years ago, thu, september 22, 2022, 8:10:33
I have a directory where there are subdirectories which have numbers as directories. For example I have a parent directory test
now I have some subdirectories like 1
,2
,3
,4
,5
,6
,7
. Now I have a local exported variable like export a=3
. I want to delete directories that are above or equal to $a
and below or equal to $a+3
, So I want to delete files 4
,5
. How can I achieve this in Ubuntu 18.04.6 LTS
.
I tried rm -rf {$a..$($a+3)}
, it didn't work, I tried so many other things but not successful.
More From » command-line