#1 Le 24/01/2012, à 00:20
- kironux
[Résolu] Espace avant commande n'enregistre pas celle-ci
Bonjour/Bonsoir à tous,
J'ai remarqué que lorsqu'on précède une commande d'un espace, celle-ci n'est pas répertoriée dans l'historique, est-ce normal ?
Merci de vos réponses
Dernière modification par kironux (Le 24/01/2012, à 01:00)
Hors ligne
#2 Le 24/01/2012, à 00:46
- wido
Re : [Résolu] Espace avant commande n'enregistre pas celle-ci
Bonjour,
pas chez moi...
Hors ligne
#3 Le 24/01/2012, à 00:50
- Watael
Re : [Résolu] Espace avant commande n'enregistre pas celle-ci
salut,
ça dépend du paramétrage de la variable d'environnement HISTCONTROL.
Connected \o/
Welcome to sHell. · eval is evil.
Hors ligne
#4 Le 24/01/2012, à 01:00
- kironux
Re : [Résolu] Espace avant commande n'enregistre pas celle-ci
Merci bien pour vos réponses.
J'ai regardé la variable $HISTCONTROL :
User@Host:~$ echo $HISTCONTROL
ignoredups:ignorespace
J'ai "vidé" la variable :
User@Host:~$ export HISTCONTROL=
User@Host:~$ echo $HISTCONTROL
Les espaces ne sont plus pris en compte.
Merci pour la réponse
Dernière modification par kironux (Le 24/01/2012, à 01:00)
Hors ligne
#5 Le 24/01/2012, à 01:07
- sputnick
Re : [Résolu] Espace avant commande n'enregistre pas celle-ci
Tu peux garder
export HISTCONTROL=ignoredups
pour ne pas garder par exemple 7
ls
de suite
On ne peut pas mettre d'array dans un string!
https://sputnick.fr/
Hors ligne
#6 Le 24/01/2012, à 01:11
- kironux
Re : [Résolu] Espace avant commande n'enregistre pas celle-ci
Merci bien !
Je recherchais un peu plus à propos de cette variable, et je suis tombé là dessus :
HISTCONTROL
A colon-separated list of values controlling how commands are saved on the history list. If the list of values includes ‘ignorespace’, lines which begin with a space character are not saved in the history list. A value of ‘ignoredups’ causes lines which match the previous history entry to not be saved. A value of ‘ignoreboth’ is shorthand for ‘ignorespace’ and ‘ignoredups’. A value of ‘erasedups’ causes all previous lines matching the current line to be removed from the history list before that line is saved. Any value not in the above list is ignored. If HISTCONTROL is unset, or does not include a valid value, all lines read by the shell parser are saved on the history list, subject to the value of HISTIGNORE. The second and subsequent lines of a multi-line compound command are not tested, and are added to the history regardless of the value of HISTCONTROL.
https://www.gnu.org/software/bash/manual/bashref.html
Et ceci : http://voidandany.free.fr/index.php/ast … stcontrol/
Merci
Hors ligne