Commande équivalent à Sed, awk, tail,head en powershell !

hackmed Messages postés 6 Date d'inscription   Statut Membre Dernière intervention   -  
zipe31 Messages postés 36402 Date d'inscription   Statut Contributeur Dernière intervention   -
Bonjour,

Je fais un script shell qui doit extraire une suite de chiffre.

Voici un exemple ou je chercher a obtenir le chiffre :
S-1-5-21-2266954777-2911002515-1883294743
comme résultat.
la commande est :
PS C:\Users\HACKMED\Searches\Pictures\Documents\script> whoami /ALL

Résultat:

PS C: \ Users \ HACKMED \ Searches \ Pictures \ Documents \ script> whoami / ALL

User Information
------------------------

Username SID
================== ================================ ==============
hackmed-pc \ hackmed S-1-5-21-2266954777-2911002515-1883294743-1000

1 réponse

zipe31 Messages postés 36402 Date d'inscription   Statut Contributeur Dernière intervention   6 430
 
Salut,

$ cat plop 
PS C: \ Users \ HACKMED \ Searches \ Pictures \ Documents \ script> whoami / ALL

User Information
------------------------

Username SID
================== ================================ ==============
hackmed-pc \ hackmed S-1-5-21-2266954777-2911002515-1883294743-1000


$ awk 'END  { print $NF }' plop 
S-1-5-21-2266954777-2911002515-1883294743-1000

0