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........:confused:

need ur urgent attention.....

Thanks and Regards,
Chandra Maroju

Did you try same command on command line with same user?
Does your file have write permission ?

  • nilesh

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.....

Last message will overwrite the file :rolleyes:, use append.

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

and for fun add a date stamp

echo "`date` error occurred" >>  [path of file]

my script has two echoes.....

echo "hello" > [path of file]

echo "world" >> [path of file]

Check [path of file] :wink:

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.....

Read the man for your shell and look for -x option.

It seems both script can write into file.
Are you sure about redirect operator? Use >> redirect operator n try.

  • nilesh