hack のためのネタ帳, etc,,,

状況

Ubuntu 20.04 LTS で vscode から bash へ script をコピペして実行してたんだけど何故か history が残ったり残らなかったりするのでしばらく頭を抱えた。

原因

どうも、コマンドラインの先頭にスペースを入れてると history が残らないらしい。

2020-06-04: 追記
これ Ubuntu 18.04.4 LTS でも起こるけど Cygwin では起こらないみたい。
$ # Cygwin
$ bash --version
GNU bash, バージョン 4.4.12(3)-release (x86_64-unknown-cygwin)
Copyright (C) 2016 Free Software Foundation, Inc.
ライセンス GPLv3+: GNU GPL バージョン 3 またはそれ以降 <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ # Ubuntu 18.04.4 LTS
$ bash --version
GNU bash, バージョン 4.4.20(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2016 Free Software Foundation, Inc.
ライセンス GPLv3+: GNU GPL バージョン 3 またはそれ以降 <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ # Ubuntu 20.04 LTS
$ bash --version
GNU bash, バージョン 5.0.16(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2019 Free Software Foundation, Inc.
ライセンス GPLv3+: GNU GPL バージョン 3 またはそれ以降 <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
bash の version の問題なのか、それとも別の要因なのか?

コメントをかく


「http://」を含む投稿は禁止されています。

利用規約をご確認のうえご記入下さい

Wiki内検索

フリーエリア

管理人/副管理人のみ編集できます