jog icon indicating copy to clipboard operation
jog copied to clipboard

cut: the delimiter must be a single character

Open puyoxyz opened this issue 3 years ago • 3 comments

❯ jog
cut: the delimiter must be a single character
Try 'cut --help' for more information.

puyoxyz avatar Nov 12 '21 19:11 puyoxyz

Happening to me too. I created the file using vim and CTRL + V the script.

For reference, I use WSL2

BobToninho avatar Nov 13 '21 17:11 BobToninho

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

niedzielski avatar Nov 13 '21 23:11 niedzielski

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.

BoZenKhaa avatar Nov 15 '21 11:11 BoZenKhaa