Set (commande)
Pour les articles homonymes, voir Set.
| Système d'exploitation | MS-DOS et Microsoft Windows |
|---|---|
| Type |
Utilitaire UNIX (d) Commande MS-DOS (en) |
Set est une commande informatique, sous Windows et sous Unix (y compris Linux), qui affiche les variables d'environnement.
Commande set sur Windows
La commande set sans aucun paramètre permet de lister les variables d’environnement. Les variables liées au shell ne sont pas affichées (exemple : %ERRORLEVEL%[1], %DATE%, %TIME%, %CD%, %RANDOM% etc.)
Cette commande permet aussi de paramétrer une variable d'environnement.
set VARIABLE=value
Exemple de résultat de cette commande sur Windows 7 (pour un utilisateur appelé Dupont sur un ordinateur dont le hostname est monbeaupc:
ALLUSERSPROFILE=C:\ProgramData APPDATA=C:\Users\dupont\AppData\Roaming CommonProgramFiles=C:\Program Files\Common Files CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files CommonProgramW6432=C:\Program Files\Common Files COMPUTERNAME=monbeaupc ComSpec=C:\Windows\system32\cmd.exe FP_NO_HOST_CHECK=NO HOMEDRIVE=C: HOMEPATH=\Users\dupont LOCALAPPDATA=C:\Users\dupont\AppData\Local LOGONSERVER=\\MONBEAUPC NUMBER_OF_PROCESSORS=8 OS=Windows NT Path=C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC PROCESSOR_ARCHITECTURE=AMD64 PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 30 Stepping 5, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=1e05 ProgramData=C:\ProgramData ProgramFiles=C:\Program Files ProgramFiles(x86)=C:\Program Files (x86) ProgramW6432=C:\Program Files PROMPT=$P$G PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ PUBLIC=C:\Users\Public SESSIONNAME=Console SystemDrive=C: SystemRoot=C:\Windows TEMP=C:\Users\dupont\AppData\Local\Temp TMP=C:\Users\dupont\AppData\Local\Temp USERDOMAIN=monbeaupc USERNAME=dupont USERPROFILE=C:\Users\dupont windir=C:\Windows
Commande set sur Unix
La commande set sans aucun paramètre liste à la fois les variables d'environnement et les variables liées au shell. Cette commande est spécifique du Shell Unix utilisée (bash, ksh, sh, etc.). Toutefois des paramètres sont disponibles[2].
La commande unset permet de détruire une variable d'environnement.
Commande "shopt" sur les versions récentes de bash
Depuis la version 2.0 du bash, il existe une commande supplémentaire à set : c'est la commande shopt ; elle a un comportement très semblable à set.
Notes et références
- ↑ Voir le document .
- ↑ (en) « Set man page », sur linuxcommand.org (consulté le ).
Voir aussi
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.