PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > Searching for the whole bash lines of a running process
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

Searching for the whole bash lines of a running process

Réponse
 
LinkBack Outils de la discussion
Vieux 09/05/2008, 08h57   #1
paolfili@supereva.it
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Searching for the whole bash lines of a running process

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

  Réponse avec citation
Vieux 09/05/2008, 11h01   #2
Stephane CHAZELAS
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Searching for the whole bash lines of a running process

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
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 17h40.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09357 seconds with 10 queries