Skip to content

Conversation

@Blacksuan19
Copy link

@Blacksuan19 Blacksuan19 commented Dec 2, 2022

.zsh_history file is saved as data leading to grep displaying a message about the file being a binary after each command, the -a flag makes grep treat binary files as text eliminating the message.

image

.z-history file is saved as data leading to grep displaying a message about the file being a binary after each command, the `-a` flag makes grep treat binary files as text eliminating the message.

before:

```bash
~
❯ read start_ts <<< "$( grep "^:" "${HISTFILE}" | tail -n1 | cut -d: -f2 )"
grep: /home/blacksuan19/.zsh_history: binary file matches
```

After:

```bash
~
❯ read start_ts <<< "$( grep -a "^:" "${HISTFILE}" | tail -n1 | cut -d: -f2 )"
```
@Blacksuan19 Blacksuan19 changed the title zsh: treat zsh history file as text zsh: makr grep treat zsh history file as text Dec 2, 2022
@Blacksuan19 Blacksuan19 changed the title zsh: makr grep treat zsh history file as text zsh: make grep treat zsh history file as text Dec 2, 2022
@Blacksuan19 Blacksuan19 changed the title zsh: make grep treat zsh history file as text zsh: make grep treat .zsh_history as text Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant