Hello folks hope all are doing well, i need to compress directories with range, i have total directories from 000-199
and i want to copy directories from 010 onwards to 020 meants total 11 directories, please suggest what regex will i use.
Thanks,
Bash
#!/bin/ksh
typeset -z3 num
num=10
while [[ $num -lt 21 ]]; do
cp $num somewhere_else/$num
(( num += 1 ))
done
not regexp but you'd need to specify language...
you could do:
/bin/ls -1d 0?? | egrep '(^01|^020)'
rdcwayx
3
tar cvf - 01? 020 |gzip > urfile.tar.gz