How can I modify input variables with string modifiers in zsh?
2
votes
2
answers
659
views
I've been working on a
bold
function as a proof-of-concept and a challenge to myself. I am trying to input text (e.g.foo
) and have it print to standard output as it's bold counterpart (**foo
**).
Context:
I've been using echo
and basing it off of my PROMPT
variable in my theme file. I am not using any frameworks.
The theme uses codes like %B%n%b
to bold the username (%n
), but I don't know how to replace that %n
with user input ($1
). Any Help?
Edit: Attempted Code
echo '%B'"$1"'%b'
-tried with and without quotes in various locations, as well as with sub-shell ({}
)
Asked by user426441
(21 rep)
Aug 1, 2020, 09:42 PM
Last activity: Aug 2, 2020, 08:21 AM
Last activity: Aug 2, 2020, 08:21 AM