unable to push messages into log file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting unable to push messages into log file
# 1  
Old 02-05-2009
unable to push messages into log file

hello all.....

I have a shell script created by the user ABC.

in that script, am trying to push some echo messages into a Log file.....

eg: echo "error occurred" > [path of file]


but for some reason, my echo messages are not getting redirected to my log file........Smilie


need ur urgent attention.....


Thanks and Regards,
Chandra Maroju
# 2  
Old 02-05-2009
Did you try same command on command line with same user?
Does your file have write permission ?

- nilesh
# 3  
Old 02-05-2009
the script is created by say user:ABC

and now, the script itself is creating the log file and echoing messages into it.

so, the user for the logfile must also be ABC by default.

wondering why the script is unable to push echo messages into that logfile.....

I really appreciate ur insights into it.....
# 4  
Old 02-05-2009
Last message will overwrite the file Smilie, use append.
Code:
echo "error occurred" >>  [path of file]

and for fun add a date stamp
Code:
echo "`date` error occurred" >>  [path of file]

# 5  
Old 02-05-2009
my script has two echoes.....

echo "hello" > [path of file]

echo "world" >> [path of file]
# 6  
Old 02-05-2009
Check [path of file] Smilie
# 7  
Old 02-05-2009
path of file is correct......

ok let me be more clear.....

I got 2 scripts.....

script1 creates a logfile and tries to push some echo message using > operator.....

Now, my script2 is getting executed, which is trying to push some more echo essages into the same logfile using >> operator.....

Now the fishy thing that is happening is........
In my logfile, am unable to find echo messages that is pushed by script1.
Rather am just able to find echo messages that is pushed by script2 only.....
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Transfer the logs being thrown into /var/log/messages into another file example /var/log/volumelog

I have been searching and reading about syslog. I would like to know how to Transfer the logs being thrown into /var/log/messages into another file example /var/log/volumelog. tail -f /var/log/messages dblogger: msg_to_dbrow: no logtype using missing dblogger: msg_to_dbrow_str: val ==... (2 Replies)
Discussion started by: kenshinhimura
2 Replies

2. Shell Programming and Scripting

Unable to attach a .txt file or .log file to mail and mailx command

Hi, I am trying to attach a .log file or .txt file to mail command to send an email once my ksh script executed. I am unable to use mutt command as it has been not installed and i am not supposed to install it. I have tried many ways by googling which has not helped me to succeed. Here is my... (5 Replies)
Discussion started by: Samah
5 Replies

3. Shell Programming and Scripting

need help in search the error messages from log file

Hi, My log file has error messages, universal no and universal ID. The problem is i have to search Universal ID from the error messages. But the log file write error messages with universal no and error messages in one line. and universal no with universal ID in other line. So i write two loops... (5 Replies)
Discussion started by: pjlotiya
5 Replies

4. Shell Programming and Scripting

Capturing errors messages into log file

Can we capture and write all the error messages which were being displayed on the command prompt screen during execution of a program into a log file? If yes, can anyone please let me know on how to do it? I am using ksh and working on AIX server. Thank you in advance. (4 Replies)
Discussion started by: vpv0002
4 Replies

5. Shell Programming and Scripting

Log file is not getting created & unable to grep error from it

Hi All, Below is my code,what I am trying to do is redirecting output of ftp to a log file & then greping the errors but here I am unable to grep "Permission denied" error only & also the corresponding log file is also not getting created. #!/bin/sh . cfg USER='abc' PASSWD='abc123' ... (4 Replies)
Discussion started by: ss_ss
4 Replies

6. Shell Programming and Scripting

Push records to array during implicit loop and write to file

NEWBIE ALERT! Hi, I'm 1 month into learning Perl and done reading "Minimal Perl" by Tim Maher (which I enjoyed enoumously). I'm not a programmer by profession but want to use Perl to automate various tasks at my job. I have a problem (obviously) and are looking for your much appreciated help.... (0 Replies)
Discussion started by: jospan
0 Replies

7. Shell Programming and Scripting

Parse out known messages from a log file

I am looking for a script to do the following. I have a large log file that contains hundreds of warnings, a lot of which can be ignored. The tool doesn't allow me to suppress it, so I like to parse it out from the log file and isolate just the new messages/warnings, based on an exception file. ... (12 Replies)
Discussion started by: cdn2008
12 Replies

8. Linux

FTP push

Hi I am trying to send a file form one linux server into an another linux server. I cannot do ftp get. Can anyone please assist me how can I push the file to the other server ? Thanks. (2 Replies)
Discussion started by: sureshcisco
2 Replies

9. HP-UX

How to Redirect the error messages from Syslog file to our own Application Log File

Hello, I am New to Unix. I am Using HP-UX 9000 Series for my Application. I am Currently Facing an Issue that the error messages are being written in the syslog file instead of the Application Log File. The Codes for that Syslog.h is written in Pro*C. I want to know how to Redirect these... (3 Replies)
Discussion started by: balasubramaniam
3 Replies

10. Solaris

unable to open a .log(4MB) file in vi

am unable to open a .log file which is 4MB size. (18 Replies)
Discussion started by: venkatramana
18 Replies
Login or Register to Ask a Question