I tried doing this and it made a bunch of mistakes with handing spaces and whatnot that makes shell scripts often brittle. Of course, a human would probably make the same mistakes, because who actually knows how to do that correctly? But it doesn’t really make me comfortable using it for anything but the smallest of automation tasks.
> who actually knows how to do that correctly?
Many people. It's not exactly rocket science to quote your arguments which already gets you most of the way there.
I already tried to customize my command line prompt with it. All the arcane colouring character decodings and random character escaping missions became a "put git branch names in parenthesis and make it cyan".
What’s so arcane about `echo "$(tput setaf 6)cyan$(tput sgr0)"`?
Uh we must be using different prompts. I'm talking about this:
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
export PS1="\u@\h \[$(tput setaf 7)\]\w\[$(tput setaf 8)\]\$(parse_git_branch)\[$(tput sgr0)\] $ "
Re:Test, [, and [[ (2020)
by rjblackman on Thursday November 23, 2023 @02:06AM
(#38390208)
yes, this is the best use case I have found for chat gpt. I've been automating away all of my little annoyances with powershell.
The programs are fairly short, examples are common in the corpus, and the syntax and execution model are so inscrutable that only a machine can pretend to understand what’s going on.