Unix Question

IF A program or database routine is writing in a file laying on unix box then how can be identify the process id which is writing in the file.

Please let me know how can we do using root command and without root command?

Regards,
Shashank

lsof <filename> can do that.

I just check on sun solaris machine but did not find any command like lsof

I did Command Prompt> man lsof

There is no command like lsof

Please suggest other command or script

try man fuser

Thanks for your reply.

Both command fuser and lsof exists. Actually lsof command is for viewing open files of processes. This command is NOT part of standard Unix but is available over the net.

Thanks again.

Regards,
Shashank Taparia

My apologies, I should have mentioned that.

Please give some examples of the use of exec command use for file descriptor.

like exec > &p
exec > 3
exec > 4

Thanks

You'll find good examples here
http://www.tldp.org/LDP/abs/html/io-redirection.html

Please give me some example of Korn shell. Although I can resemble the bash shell with Korn shell.

The article you sent is giving the knowlwdge of syntax but I would like to see the use of command like

exec i>&j

where to redirect file o/p of i to fileoutput J and then use file o/p of J for some purpose.

Same wat what is the use of 2>&1 , why we need to redirect the stderr to stdout file descriptor. If simply we need to transfet the the stderr then we can use 2 >> $FILENAME . What we are using 2 > &1.

Thanks for your help in advance.

Regards,
Shashank Taparia

See one think I understood that using 1 >>$FILENAME is not good then using

1> &p possibaly reason is not to crearte a physical file , just open a file descripor and later add the content to the file $FILENAME. is syntax for that is

p>. $FILENAME

Am I right above?

Thanks,

Regards,
Shashank

Just make an effort and read the chapter I've given above. Then all will be clear for you