Closed lsimonne closed 7 years ago
notre history est comme celui de bash c'est ça ?
oui
j'ai suis pas sur d'avoir compris la différence entre -a et -w
./42sh 2>errlog
[n0iz@nomad ~/Projects/42sh]$ qsdqsdqsd
[n0iz@nomad ~/Projects/42sh]$ history -p !!
history -p qsdqsdqsd
history -p qsdqsdqsd
qsdqsdqsd
[n0iz@nomad ~/Projects/42sh]$
sh (mon sh est un lien symbolique vers bash en mode posix)
sh-4.4$ qsdqsdqsd
sh: qsdqsdqsd: command not found
sh-4.4$ history -p !!
history -p qsdqsdqsd
qsdqsdqsd
sh-4.4$
ça imprime 2 fois la ligne dans le 42sh
-w écrase le fichier pour écrire l'history -a append à la fin du fichier les entrées pas encore écrites (par a ou w)
[ChezLouise@ ~/Documents/42/42sh]$ history -w file
executing builtin history
done executing builtin history, ok
[ChezLouise@ ~/Documents/42/42sh]$ cat file
one
two
three
four
five
un deux trois quatre cinq
history
history -w file
[ChezLouise@ ~/Documents/42/42sh]$ history -c
executing builtin history
done executing builtin history, ok
[ChezLouise@ ~/Documents/42/42sh]$ history -w file
executing builtin history
done executing builtin history, ok
[ChezLouise@ ~/Documents/42/42sh]$ cat file
history -w file
[ChezLouise@ ~/Documents/42/42sh]$
[ChezLouise@ ~/Documents/42/42sh]$ toto
42sh: toto: No such file or directory
[ChezLouise@ ~/Documents/42/42sh]$ titi
42sh: titi: No such file or directory
[ChezLouise@ ~/Documents/42/42sh]$ history -a file
executing builtin history
done executing builtin history, ok
[ChezLouise@ ~/Documents/42/42sh]$ cat file
history -w file
cat file
toto
titi
history -a file
[ChezLouise@ ~/Documents/42/42sh]$
sh
sh-4.4$ history -p !!
history -p un deux trois quatre cinq
un
deux
trois
quatre
cinq
42sh:
[n0iz@nomad ~/Projects/42sh]$ history -p !!
history -p un deux trois quatre cinq
executing builtin history
done executing builtin history, ok
ah oui merde c'était pour ça - ok faut que j'arrête de faire 10 choses en même temps, je regarderai ça demain !
Sinon tout le reste du builtin history a l'air ok, pas encore checké les substitution d'historique avancée.
c'est normal les event not found ?
[n0iz@nomad ~/Projects/42sh]$ history
executing builtin history
1 one
2 two
3 three
4 four
5 five
6 un deux trois quatre cinq
7 history
8 history
done executing builtin history, ok
[n0iz@nomad ~/Projects/42sh]$ history -p !one
history -p one executing builtin history
one
done executing builtin history, ok
[n0iz@nomad ~/Projects/42sh]$ history -p !fi
42sh: !fi: event not found
[n0iz@nomad ~/Projects/42sh]$ history -p !un
42sh: !un: event not found
[n0iz@nomad ~/Projects/42sh]$ history -p !t
42sh: !t: event not found
[n0iz@nomad ~/Projects/42sh]$
négatif. on it.
[n0iz@nomad ~/Projects/42sh]$ word bla
42sh: word: No such file or directory
[n0iz@nomad ~/Projects/42sh]$ history -p ^word^thing^
history -p word blaword^thing^
[n0iz@nomad ~/Projects/42sh]$
c'est pas sensé output :
history -p thing bla
?
go finir cette branche pour plus avoir de random travis fail (hopefully) @lsimonne
yes, je fix le problème que t'as soulevé (le fail de travis de execve c'est pas l'history!)
oui oui je sais pour execve mais comme ça ya pas de confusion
Builtin:
Bang: