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.
Can you say a little more about the script /usr/local/monapp/monclient and its nature? It is what you would have to modify if you want the date-time to appear on every line of output that it produces.
Alternately, you might be able to wedge something in before your redirect.
Can you say a little more about the script /usr/local/monapp/monclient and its nature? It is what you would have to modify if you want the date-time to appear on every line of output that it produces.
Alternately, you might be able to wedge something in before your redirect.
It is a client that monitors the local machine and send data to a remote server. It's logging functionality is limited to periodical writing to stdout debugging messages, and it does not include a timestamp with each message.
Looks like your script is searching for the date in each message sent to stdout?
It is a client that monitors the local machine and send data to a remote server. It's logging functionality is limited to periodical writing to stdout debugging messages, and it does not include a timestamp with each message.
Looks like your script is searching for the date in each message sent to stdout?
Almost. It gets the date and time from the date utility and appends that to each line sent to stdout. However, see the updated version, I missed a proper close() function to force awk to get a new time for each line.
I've tried a couple of iterations, but this one errors with 25: local: +"%F: bad variable name, and the commented out one errors with awk: cannot open 3 (No such file or directory) bash: 3: Bad file descriptor.
I've tried a couple of iterations, but this one errors
Yep. You have nested quotes which have to be escaped properly. When you have only two levels, you can alternate single ' and double " quotes to come to a solution. With three levels, it's significantly harder to look at:
The -e will stop the script if an error is encountered.
The -x will show you verbatim the command which will run, including all options. Whatever that shows should give you an idea of what the problem would be. In addition to the previous guess, I'd say trying to run the program in the background with the & is going to throw the results off.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.