Add history file read/write to bash

Close #21.
master
Roman Mueller 2018-09-13 18:49:09 +02:00 committed by Andrea Cardaci
parent b10791a840
commit 9bac306503
1 changed files with 13 additions and 0 deletions

View File

@ -40,11 +40,24 @@ functions:
- code: |
export LFILE=file_to_write
bash -c 'echo DATA > $LFILE'
- description: This adds timestamps to the output file.
code: |
LFILE=file_to_write
HISTIGNORE='history *'
history -c
DATA
history -w $LFILE
file-read:
- description: It trims trailing newlines and it's not binary-safe.
code: |
export LFILE=file_to_read
bash -c 'echo "$(<$LFILE)"'
- description: The read file content is surrounded by the current history content.
code: |
LFILE=file_to_read
HISTTIMEFORMAT=$'\r\e[K'
history -r $LFILE
history
suid-enabled:
- code: "./bash -p"
sudo-enabled: