SHTOOL-ECHO.TMP(1)

πŸ“¦
version 2.0.8 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

✨ shtool-echo β€” the manual page, bestie edition ✨

okay so welcome to SHTOOL-ECHO.TMP(1), which lives inside the GNU Portable Shell Tool and is literally just echo(1) but with ✨extras✨. grab a boba, we're doing this. πŸ’–


🌸 NAME 🌸

shtool-echo β€” the GNU shtool echo(1) extensional command. yes bestie, "extensional," that's the word, we're keeping it. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

shtool echo [-n|--newline] [-e|--expand] string

πŸ‘‘ DESCRIPTION πŸ‘‘

so shtool echo is an echo(1)-style command, right? it prints string to stdout, and optionally it gives you some special expansion constructs (think terminal bold mode, environment details, the date, that whole vibe) plus newline control. πŸŽ€

the trick β€” and honestly the whole point β€” is that this command gives you a portable -n option, and it hides all the gory details you'd normally need just to figure out your environment details, tucking all of that away under the -e option. no cap. πŸ”₯


✨ OPTIONS ✨

here's everything you can pass it, bestie:

  • -n, --newline β€” by default, output gets written to stdout and then followed by a "newline" (that's ASCII character 0x0a, for the record). if you use -n, that newline character is omitted. poof, gone. πŸ™ˆ
  • -e, --expand β€” if you use -e, then string is allowed to contain special "%x" constructs, and those get expanded before the output is written. right now, these are the constructs that are recognized:
    • %B β€” switch terminal mode to bold display mode. πŸ’ͺ
    • %b β€” switch terminal mode back to normal display mode. phew.
    • %u β€” the current user name.
    • %U β€” the current user id (numerical).
    • %g β€” the current group name.
    • %G β€” the current group id (numerical).
    • %h β€” the current hostname (without any domain extension).
    • %d β€” the current domain name.
    • %D β€” the current day of the month.
    • %M β€” the current month (numerical).
    • %m β€” the current month name.
    • %Y β€” the current year.

🌈 EXAMPLE 🌈

here's the moment you've been waiting for, an actual shell script:

#   shell script
shtool echo -n -e "Enter your name [%B%u%b]: "; read name
shtool echo -e "Your Email address might be %u@%h%d"
shtool echo -e "The current date is %D-%m-%Y"

look at that. it ate. πŸ‘‘


πŸ’œ HISTORY πŸ’œ

the GNU shtool echo command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 1998 for the Website META Language (WML), back when it went by the name buildinfo. later it got taken over into GNU shtool. glow-up story fr fr. 🌟


🫢 SEE ALSO 🫢

shtool(1), echo(1).


and that's the whole page, bestie! this was shtool 2.0.8, dated 18-Jul-2008, from the GNU Portable Shell Tool β€” thanks for reading, mwah, bye πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from