Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
well as the error clearly states, there is an unmatched square bracket:
Code:
awk -F['{print $2}'
it won't be matched by the one in
Code:
awk -F] '{print $1}'
as there is a pipe in the middle, making them two separate bash commands.
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.
Last edited by acid_kewpie; 02-14-2012 at 07:16 AM.
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?
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.
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.