Technopedia Center
PMB University Brochure
Faculty of Engineering and Computer Science
S1 Informatics S1 Information Systems S1 Information Technology S1 Computer Engineering S1 Electrical Engineering S1 Civil Engineering

faculty of Economics and Business
S1 Management S1 Accountancy

Faculty of Letters and Educational Sciences
S1 English literature S1 English language education S1 Mathematics education S1 Sports Education
  • Registerasi
  • Brosur UTI
  • Kip Scholarship Information
  • Performance
  1. Weltenzyklopädie
  2. unset — Wikipédia
unset — Wikipédia 👆 Click Here! Read More..
Un article de Wikipédia, l'encyclopédie libre.
(Redirigé depuis Unset (Unix))

Cet article est une ébauche concernant l’informatique.

Vous pouvez partager vos connaissances en l’améliorant (comment ?) selon les recommandations des projets correspondants.
Unset

Informations
Type Utilitaire UNIX (d)Voir et modifier les données sur Wikidata

modifier - modifier le code - voir Wikidata (aide)

unset (de l'anglais to unset que l'on pourrait traduire par rendre indéfini) est une commande Unix[1] qui efface de la mémoire les variables passées en paramètre. Cette commande ne retourne aucun résultat (void).

Liste des paramètres

[modifier | modifier le code]
  • -v : détruit une variable (comportement par defaut)
  • -f : détruit une fonction

Exemple d'utilisation

[modifier | modifier le code]

Note: la première ligne correspond au shebang et les informations précédées d'un croisillon « # » sont des commentaires.

Avec une variable :

#!/bin/sh
ma_variable='Hello world!'     # on définit une variable et on lui affecte une valeur
echo $ma_variable              # on affiche la valeur de la variable
unset ma_variable              # on détruit la variable (identique à unset -v ma_variable)
echo $ma_variable              # rien n'est affiché car la variable n'existe plus

Avec une fonction et le paramètre -f :

#!/bin/sh
ma_fonction()
{
    echo "Bonjour le monde!"
}
ma_fonction                    # on appelle la fonction qui affiche « Bonjour le monde! »
unset -f ma_fonction           # on détruit la fonction
ma_function                    # affiche une erreur similaire à « ma_fonction: not found » car la fonction n'existe plus

Autres langages

[modifier | modifier le code]
Article détaillé sur Wikibooks : Translinguisme, programmation.

unset est également disponible dans :

  • PHP (via la fonction du même nom)[2]

Notes et références

[modifier | modifier le code]
  1. ↑ unset values and attributes of variables and functions – Shell Command Language, The Single UNIX® Specification, Issue 7, publié par The Open Group (internet archive)
  2. ↑ « PHP : unset - Manual », sur php.net (consulté le 23 octobre 2021).
v · m
Commandes Unix
Aide
  • uname
  • apropos
  • help
  • file
  • history
  • info
  • man
  • type
  • whatis
Environnement utilisateur
  • env
  • dmesg
  • finger
  • halt
  • id
  • init
  • logname
  • mesg
  • passwd
  • reboot
  • shutdown
  • su
  • sudo
  • talk
  • uptime
  • w
  • wall
  • who
  • whoami
  • write
Gestion de processus
  • at
  • bg
  • chroot
  • crontab
  • disown
  • exit
  • fg
  • htop
  • iowait
  • jobs
  • kill
  • nice
  • nohup
  • pkill
  • ps
  • pstree
  • sleep
  • time
  • top
Manipulation de texte
  • awk (gawk)
  • banner
  • bash
  • cat
  • clear
  • cut
  • diff
  • ed
  • ex
  • head
  • join
  • nl
  • paste
  • patch
  • read
  • sed
  • sort
  • strings
  • tail
  • tee
  • tr
  • uniq
  • vi
  • vim
  • wc
Programmation shell
  • alias
  • basename
  • dirname
  • echo
  • expr
  • false
  • printf
  • set
  • test
  • true
  • unset
  • wait
Recherche
  • find
  • grep
  • locate
  • whereis
  • which
Réseau
  • cURL
  • ethtool
  • ftp
  • host
  • ifconfig
  • mail
  • mailx
  • mii-tool
  • nc
  • netstat
  • ping
  • rlogin
  • ssh
  • sftp
  • telnet
  • traceroute
  • wget
Système de fichiers
  • cd
  • chgrp
  • chmod
  • chown
  • cp
  • dd
  • df
  • dir
  • du
  • file
  • less
  • ln
  • ls
  • lsof
  • mkdir
  • more
  • mount
  • mv
  • pwd
  • rm
  • rmdir
  • split
  • touch
  • tree
  • umask
  • umount
Divers
  • bc
  • dc
  • cal
  • date
  • fc
  • lp
  • lpr
  • md5sum
  • icône décorative Portail de l’informatique
Ce document provient de « https://fr.teknopedia.teknokrat.ac.id/w/index.php?title=Unset&oldid=187382138 ».
Catégorie :
  • Commande Unix
Catégories cachées :
  • Wikipédia:ébauche informatique
  • Page utilisant P31
  • Article utilisant une Infobox
  • Portail:Informatique/Articles liés
  • Portail:Technologies/Articles liés

  • indonesia
  • Polski
  • الرية
  • Deutsch
  • English
  • Español
  • Français
  • Italiano
  • مصر
  • Nederlands
  • 本語
  • Português
  • Sinugboanong Binisaya
  • Svenska
  • Українска
  • Tiếng Việt
  • Winaray
  • 中文
  • Русски
Sunting pranala
Pusat Layanan

UNIVERSITAS TEKNOKRAT INDONESIA | ASEAN's Best Private University
Jl. ZA. Pagar Alam No.9 -11, Labuhan Ratu, Kec. Kedaton, Kota Bandar Lampung, Lampung 35132
Phone: (0721) 702022
Email: pmb@teknokrat.ac.id