Setting 2 files for grep search in 1 unique variable
by pedropt from LinuxQuestions.org on (#6CR4W)
Hi everyone , i am stuck here with a doubt , i want to set 2 files for grep search but i want to use them as an unique variable of both .
What i need :
Quote:
I get an error of file missing , but file is there .
I know that i can use them like this and it works :
Quote:
however if i set those 2 logs in 1 single variable i get an error .
I was thinking in setting just 1 log variable as :
log="/var/log/nginx/access.log*"
but this will include also the gzip files inside nginx logs directory , witch are access.log.2.gz , etc... , and i do not want that .
Any ideas how can i manage to set those 2 logs in one unique variable ?
Thank you
What i need :
Quote:
log1="/var/log/nginx/access.log" log2="/var/log/nginx/access.log.1" weblog="$log1" "$log2" some command in grep next : grep "something" "$weblog" |
I know that i can use them like this and it works :
Quote:
grep "something" "$log1" "$log2" |
I was thinking in setting just 1 log variable as :
log="/var/log/nginx/access.log*"
but this will include also the gzip files inside nginx logs directory , witch are access.log.2.gz , etc... , and i do not want that .
Any ideas how can i manage to set those 2 logs in one unique variable ?
Thank you