I am using SCO Openserver 5.0.7.
Where does the ps -ef command pick the information from? Is it stored in some file?
Also, the ps -ef command or the ps -eo args command displays truncated information. How to get the complete expanded output without truncation?
I don't know the SCO Openserver in detail.
But this problem is common to most if not all Unix.
There is a kernel memory access device like /dev/kmem, or a special /proc filesystem that provides access to some selected kernel memory.
Usually the process args are fully known only to the process itself,
while the kernel maintains a common area of all process args that is limited to usually 80 characters.
The ps command accesses the common kernel area, therefore the truncation.
The Solaris OS has "/usr/ucb/ps axww" that (with root rights) visits each process's private memory to provide full args.
Is there a way to echo the command lines when executing a script? Actually I want to see the full command of the linker (ld) that the Cobol-85 compiler fires internally while compiling a Cobol-85 code. I was using ps -ef for that.
Many bourne-like shells support set -x , which enables tracing. When enabled, the shell will write to standard error the result of all expansions and substitutions, the final form of the command it's about to run.
Alternatively, you can try truss to monitor system call activity, looking for the exec* system call which loads an executable image into a process.
Thanks a lot Chubler_XL for that great idea. The only thing is that the shell script did not work. I wrote a small C program instead, that does the same thing as the script - that is, displaying the parameters using the argv[] variables and then running the actual ld command using the system() function.
To answer Corona's query, I suppose the Cobol-85 compiler is able to distinguish between a shell script and a compiled code. When run separately, the shell script works just fine, but the Cobol-85 compiler rejects it with a "Cannot execute" error. It just struck me to try the same thing with a compiled code - so I wrote a little C program to just display the command line parameters and then pass on the same to the renamed ld command through the system() function.