jog
jog copied to clipboard
cut: the delimiter must be a single character
❯ jog
cut: the delimiter must be a single character
Try 'cut --help' for more information.
Happening to me too. I created the file using vim and CTRL + V the script.
For reference, I use WSL2
You might be able to use sed, awk, or another alternative. Something like sed 's%⋮.*$%%'
.
I am using Bash so my full configuration is something like:
# .bashrc
# to-do: deduplicate repeated commands. `fc -ln -1` yields the last executed command but omits empties.
PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND;} fc -ln -1|sed -r \"s%^\s+(.*)%\1⋮\$PWD%\" >> ~/.bash_history_jog"
# jog
#!/usr/bin/env sh
grep -E "⋮${PWD}$" ~/.bash_history_jog |
grep -vE "jog.*⋮" |
sed 's%⋮.*$%%' |
tail
Thanks, replacing sed
with cut
:
grep -v "jog" ~/.zsh_history_ext | grep -a --color=never "${PWD} " | sed 's%⋮.*$%%' | tail
fixed the script for me in WSL2.