awk error
I've got this code but it shows error message.
Code:
#!/bin/bash Quote:
Thanks in advance. |
well as the error clearly states, there is an unmatched square bracket:
Code:
awk -F['{print $2}' Code:
awk -F] '{print $1}' Oh, actually you want to use those as the field delimters... well as below, I would suggest starting from scratch really, but escape them with a \ first... -F\[ or -F'[' shoudl also work. |
Personally I think you need to completely revise your current string of commands. The repetitive nature of calling awk after awk is definitely not required.
Perhaps you could show some of your data and what it is you need to capture? For example: Code:
awk '$2 == 30 {print $3 $7}' | awk '{print $1 $3}' |
grail/
Please understand I am not an programmer and did not make this code. I found at some webpage - which I forgot now - this code works to clean "/var/log/messages" file periodically. |
No it doesn't work at all! what's the webpage?
That REALLY is not programming though... it's pretty simple sysadmin stuff. |
|
Well without being able to understand the Korean portions of the page, the line would still not work even for the original user for reasons I have already said.
How about we go back to where you explain what it is you need to be retrieving from /var/log/messages and show an example and we can help you with something that will work? |
/grain
Thanks for your concerns. Please be understood the author of this code said, For preventing hacker's trying to connect ftp repeatedly, this code reads /var/logs/message and store data and the numbers of how many times some ftp tries to connect to the server without permission - with wrong id and password. And this code write down ftp ip which is tyied to connect with wrong information, and automatically banned the ftp ip from ftp port if the ftp ip tries over "num" tries. After I read this post, I thought if so this would be grate for my server's security. |
The theory sounds good but as I and others have pointed out, the current code will not work irrelevant of the intended solution.
|
grail/ I appreciate for your kindness.
|
All times are GMT -5. The time now is 10:55 PM. |