|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hello.
I try to make the example in Solaris. bash>(while:;do builtins1 ; sleep 777;builtins2;done) & *** 2 questions: i) builtins1,builtins2 are really fast in execution.Using ps you can find always ONLY the sleep. With ptree you can see only the originary bash from wich sleep was launched. Is there any way to make a complete reconstruction of the line launched from the shell? (ptools,truss,direct access to /proc filesystem) ii)any way to change anything during sleep so that,after sleep will be launched a new different builtins3? thanks |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
2008-05-9, 00:57(-07), paolfili@supereva.it:
> Hello. > I try to make the example in Solaris. > > bash>(while:;do builtins1 ; sleep 777;builtins2;done) & > *** > 2 questions: > > i) builtins1,builtins2 are really fast in execution.Using ps you can > find always ONLY the sleep. > With ptree you can see only the originary bash from wich sleep was > launched. > Is there any way to make a complete reconstruction of the line > launched from the shell? > (ptools,truss,direct access to /proc filesystem) No, ps shows processes and the arguments that were passed to their (or their parent's if they didn't do any) last call to execve(). That command line is only information internal to the shell. So unless you've taken dispositions beforhand so that the shell makes that information available in some way (for instance by using set -x or some trick with the ERR trap), you can't generally access it. The best you can do is use a debugger to attach to the running process and peek some information from there. > ii)any way to change anything during sleep so that,after sleep will be > launched a new different builtins3? [...] Same thing, either you've taken your dispositions beforehand or you'll have to use a debugger and hope you can alter the shell's memory. -- Stéphane |
|
![]() |
| Outils de la discussion | |
|
|