My script reads all the log files in a directory, the user would enter a range and the script would only display the files within those range. Here's my code:
#!/bin/bash
LOG_FILES=("Sandbox/logs/*")
for file in ${LOG_FILES[@]}; do echo $file; done
-------------
for i in $(seq $1 $2); do echo $i; done
The first loop display all the files in the log directory. The second loop display numbers within that range. These 2 loops work but I don't know how to combine them together.
I would like the script to read all the files in the log directories and only echo out the files within a range of say, 20 to 24. So my output would be:
server.logs-2017-04-20
server.logs-2017-04-21
server.logs-2017-04-22
server.logs-2017-04-23
server.logs-2017-04-24
Any suggestions? tks