Hi,
I have a test script which zips the log files in a folder.
#!/bin/ksh
cd /home/rt/Test_Zip
z=`ls *.log`
for i in $z
gzip $i > "$i"_`date +%m%d%y`.gz
done
The folder has 4 log files, When I run the script, It ends up with only zipping 2 files that are smaller in size. For other 2 files an error is thrown as below-
s0989pdv:/home/rt$ ./Logs_Zip.sh
detailLog_22Mar.log[1]: [main@: not found [No such file or directory]
detailLog_22Mar.log[2]: DetailedFile: not found [No such file or directory]
detailLog_22Mar.log[4]: [main@: not found [No such file or directory]
detailLog_22Mar.log[5]: Command: not found [No such file or directory]
detailLog_22Mar.log[6]: PRTMSGDM: not found [No such file or directory]
detailLog_22Mar.log[8]: [main@: not found [No such file or directory]
detailLog_22Mar.log[9]: MACHINE: not found [No such file or directory]
detailLog_22Mar.log[10]: -------------------: not found [No such file or directory]
detailLog_22Mar.log[11]: Host: not found [No such file or directory]
detailLog_22Mar.log[12]: System: not found [No such file or directory]
detailLog_22Mar.log[13]: Num: not found [No such file or directory]
detailLog_22Mar.log[15]: OS: not found [No such file or directory]
detailLog_22Mar.log[16]: --------------: not found [No such file or directory]
detailLog_22Mar.log[17]: OS: not found [No such file or directory]
detailLog_22Mar.log[18]: OS: not found [No such file or directory]
detailLog_22Mar.log[20]: LIMIT: not found [No such file or directory]
detailLog_22Mar.log[21]: -----------------: not found [No such file or directory]
detailLog_22Mar.log[22]: Core: not found [No such file or directory]
detailLog_22Mar.log[23]: Data: not found [No such file or directory]
detailLog_22Mar.log[24]: File: not found [No such file or directory]
detailLog_22Mar.log[25]: Max: not found [No such file or directory]
detailLog_22Mar.log[26]: Open: not found [No such file or directory]
detailLog_22Mar.log[27]: Stack: not found [No such file or directory]
detailLog_22Mar.log[28]: CPU: not found [No such file or directory]
detailLog_22Mar.log[30]: JAVA: not found [No such file or directory]
detailLog_22Mar.log[31]: ---------------: not found [No such file or directory]
detailLog_22Mar.log[32]: Java: not found [No such file or directory]
detailLog_22Mar.log[33]: Java: not found [No such file or directory]
detailLog_22Mar.log[34]: Java: not found [No such file or directory]
detailLog_22Mar.log[35]: Java: not found [No such file or directory]
detailLog_22Mar.log: line 35: syntax error at line 36: `(' unexpected
Temp.log[1]: Tue: not found [No such file or directory]
Temp.log[2]: Running: not found [No such file or directory]
Temp.log: line 3: Tue: not found
Please help me...