2018-09-01 12:01:15 +02:00
|
|
|
---
|
|
|
|
functions:
|
|
|
|
file-write:
|
2018-09-01 13:02:33 +02:00
|
|
|
- description: Resulting file will contain additional timestamp lines in the format of `#1535795174` for each data line.
|
2018-09-01 12:01:15 +02:00
|
|
|
- code: |
|
|
|
|
LFILE=file_to_write
|
2018-09-01 13:00:10 +02:00
|
|
|
HISTIGNORE='history *'
|
2018-09-01 12:01:15 +02:00
|
|
|
history -c
|
|
|
|
DATA
|
2018-09-01 13:00:10 +02:00
|
|
|
history -w $LFILE
|
2018-09-01 12:01:15 +02:00
|
|
|
file-read:
|
|
|
|
- description: The file content will be surrounded by your current bash history session content.
|
|
|
|
- code: |
|
|
|
|
LFILE=file_to_read
|
|
|
|
HISTTIMEFORMAT=$'\r\e[K'
|
|
|
|
history -r $LFILE
|
|
|
|
history
|
|
|
|
sudo-enabled:
|
|
|
|
- code: |
|
|
|
|
LFILE=file_to_read
|
|
|
|
sudo bash -c "HISTTIMEFORMAT=$'\r\e[K' && history -r $LFILE && history"
|
|
|
|
---
|