ps

get exact argument list of a process using ps

I am writing a session saver for GNU Screen. It needs to get every process argument list. Linux has /proc/PID/cmdline which separates arguments with \0. Solaris has pargs. But I am looking for a more crossplatform solution and ps tool seems to be the best bet. "ps -o command" displays argument list but separates arguments only with space...

How to get a process tree trace/log of a process in linux?

Hello, I want to know what executables a script launches and in what order (and trace those executables recursively). For example, let's say I have a bash script here (called abc.sh): #!/bin/bash ls gcc I'd like to run this script with a "trace/log command" and get something like this: abc.sh -- ls |-- gcc -- cpp ...