cd /path/to/linenoise-ng-1.0.1/build ./example
输入“hello,world!”,按“Enter”键,再输入“this is linux”,按“Enter”键,然后按“Ctrl+C”退出。
cat history
回显信息结果如下所示。
# ./example starting... linenoise> hello,world! thanks for the input. linenoise> this is linux thanks for the input. linenoise> ^C # cat history hello,world! this is linux