Please, can we have sample of jandat.logs, jansig.log. Also a script is suppose to work, even if that contains error or gives undesired output. So by not working, I assume, you are not getting desired output
-rw-r--r-- 1 infodba tcgrp 6935 Feb 1 15:00 tcserver16557.syslog
-rw-r--r-- 1 infodba tcgrp 6935 Feb 1 15:03 tcserver16675.syslog
so my first line of script should copy names of tcserver*.syslog created on Feb 1 to a file1, then i need to read all the files to see if they have "EXCEPTION: O/S ERROR: signal 6" and then copy those name to File2
---------- Post updated at 05:46 AM ---------- Previous update was at 05:25 AM ----------
here is what i get wehn execute the script, (it create the list of file in jandat.logs) but while reading it failes
+ [[ -z ]]
+ unset STR
+ read LOG
+ + grep -i EXCEPTION: O/S ERROR: signal 6 -rw-r--r-- 1 infodba tcgrp 263630 Dec 21 17:38 tcserver20953.syslog
grep: can't open -rw-r--r--
grep: can't open 1
grep: can't open tcgrp
grep: can't open 263630
grep: can't open Dec
grep: can't open 21
grep: can't open 17:38
STR=
+ [[ -z ]]
+ unset STR
+ read LOG
+ + grep -i EXCEPTION: O/S ERROR: signal 6 -rw-r--r-- 1 infodba tcgrp 263630 Dec 21 17:44 tcserver21009.syslog
grep: can't open -rw-r--r--
grep: can't open 1
grep: can't open tcgrp
grep: can't open 263630
grep: can't open Dec
grep: can't open 21
grep: can't open 17:44
STR=
+ [[ -z ]]
+ unset STR
+ read LOG
+ + grep -i EXCEPTION: O/S ERROR: signal 6 -rw-r--r-- 1 infodba tcgrp 263630 Dec 21 18:02 tcserver21188.syslog
grep: can't open -rw-r--r--
grep: can't open 1
grep: can't open tcgrp
grep: can't open 263630
grep: can't open Dec
grep: can't open 21
grep: can't open 18:02
STR=
+ [[ -z ]]
+ unset STR
+ read LOG