mirror of
https://github.com/kou029w/_.git
synced 2025-02-26 18:55:16 +00:00
Compare commits
2 commits
542bcbf4dd
...
9aec2d3161
Author | SHA1 | Date | |
---|---|---|---|
9aec2d3161 | |||
058cb26626 |
3 changed files with 28 additions and 0 deletions
1
histfilesize/.bashrc
Normal file
1
histfilesize/.bashrc
Normal file
|
@ -0,0 +1 @@
|
|||
HISTFILESIZE=16777215
|
22
histfilesize/README.md
Normal file
22
histfilesize/README.md
Normal file
|
@ -0,0 +1,22 @@
|
|||
# Bash `HISTFILESIZE` の限界
|
||||
|
||||
```console
|
||||
$ seq 0 $((0x7fffffff)) > .bash_history
|
||||
$ wc -l .bash_history
|
||||
2147483648 .bash_history
|
||||
$ echo $((0x7fffffff))
|
||||
2147483647
|
||||
$ docker compose run --rm bash
|
||||
root@ff1161946537:/# 225859065
|
||||
$ wc -l .bash_history
|
||||
16777215 .bash_history
|
||||
```
|
||||
|
||||
- 225859066 行 (< 0x7fffffff bytes) まで読み込まれた
|
||||
- `HISTFILESIZE=$((0x7fffffff))` 以上にするのは意味がない
|
||||
- `HISTFILESIZE=$((0x7fffff))` 行に切り落とせる
|
||||
- `HISTFILESIZE=$((0xffffff))` 行に切り落とせる
|
||||
- `HISTFILESIZE=$((0x7fffffff))` では .bash_history が大きいとハングすることがあった
|
||||
- このあたりが限界だろう
|
||||
- 0xffffff 行くらいまでならおそらく OK だろう
|
||||
- ちなみに `HISTFILESIZE=-1` はどうかというと、これも .bash_history が大きいとハングした
|
5
histfilesize/compose.yml
Normal file
5
histfilesize/compose.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
services:
|
||||
bash:
|
||||
image: ubuntu:jammy
|
||||
volumes:
|
||||
- "./:/root"
|
Loading…
Add table
Reference in a new issue