informatique:linux:commandes_linux
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
informatique:linux:commandes_linux [2020/01/07 15:09] – [date] pteu | informatique:linux:commandes_linux [2020/01/08 10:50] – [type] pteu | ||
---|---|---|---|
Line 460: | Line 460: | ||
<code bash> | <code bash> | ||
pkill -USR1 dd | pkill -USR1 dd | ||
+ | </ | ||
+ | |||
+ | |||
+ | =====declare===== | ||
+ | |||
+ | Permet de déclarer des variables en bash et leur affecter des attributs ; il équivaut à la commande '' | ||
+ | |||
+ | Liste des attributs existants : | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | Utiliser '' | ||
+ | |||
+ | <code bash> | ||
+ | # exemple d' | ||
+ | declare -i int=2 | ||
+ | echo "int vaut $int" | ||
+ | let "int += 1" | ||
+ | echo "int vaut $int" | ||
+ | unset int | ||
+ | |||
+ | # exemple d' | ||
+ | declare -r const=pierre | ||
+ | echo "const vaut $const" | ||
+ | const=sable | ||
+ | echo "const vaut $const" | ||
</ | </ | ||
Line 2607: | Line 2640: | ||
=====type===== | =====type===== | ||
- | **type** est une commande interne de bash qui indique comment chaque | + | **type** est une commande interne de bash qui permet de savoir à quoi correspond un "nom" |
- | * '' | ||
<code bash> | <code bash> | ||
- | # lister toutes les fonctions | + | type -t ls |
- | declare | + | builtin |
- | [..] | + | type -t l |
- | declare | + | alias |
+ | type l | ||
+ | l is aliased to ' | ||
+ | |||
+ | type -t ssh | ||
+ | | ||
+ | type ssh | ||
+ | ssh is hashed (/ | ||
- | # afficher le code de celle-ci (équivalent de " | ||
type -a titreterm | type -a titreterm | ||
- | titreterm | + | titreterm |
- | titreterm () | + | |
- | { | + | { |
if [[ $# -eq 1 && -n $1 ]]; then | if [[ $# -eq 1 && -n $1 ]]; then | ||
echo -ne " | echo -ne " | ||
fi | fi | ||
- | } | + | } |
</ | </ | ||
+ | |||
+ | Voir aussi : [[informatique: | ||
=====update-rc.d===== | =====update-rc.d===== |
informatique/linux/commandes_linux.txt · Last modified: 2024/04/05 06:58 by pteu