Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Usage: ./script 201701 201703
- From=$(date -d $(sed 's/^\(....\)\(..\).*/\1-\2-01/' <<<$1) +%s)
- To=$(date -d $(sed 's/^\(....\)\(..\).*/\1-\2-01/' <<<$2) +%s)
- for f in test_*.tar.gz; do
- date=$(date -d $(sed 's/^test_\(....\)\(..\).*/\1-\2-01/' <<<$f) +%s)
- if (( From <= date && date <= To )); then
- echo $f
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement