1SHTOOL-ECHO.TMP(1) GNU Portable Shell Tool SHTOOL-ECHO.TMP(1)
2
3
4
6 shtool echo - GNU shtool [22mecho(1) extensional command
7
9 shtool echo [-n|--newline] [-e|--expand] string
10
12 shtool echo is an echo(1) style command which prints string to stdout
13 and optionally provides special expansion constructs (terminal bold
14 mode, environment details, date, etc) and newline control. The trick of
15 this command is that it provides a portable -n option and hides the
16 gory details needed to find out the environment details under option
17 -e.
18
20 The following command line options are available.
21
22 -n, --newline
23 By default, output is written to stdout followed by a "newline"
24 (ASCII character 0x0a). If option -n is used, this newline
25 character is omitted.
26
27 -e, --expand
28 If option -e is used, string can contain special "%x" constructs
29 which are expanded before the output is written. Currently the
30 following constructs are recognized:
31
32 %B switch terminal mode to bold display mode.
33
34 %b switch terminal mode back to normal display mode.
35
36 %u the current user name.
37
38 %U the current user id (numerical).
39
40 %g the current group name.
41
42 %G the current group id (numerical).
43
44 %h the current hostname (without any domain extension).
45
46 %d the current domain name.
47
48 %D the current day of the month.
49
50 %M the current month (numerical).
51
52 %m the current month name.
53
54 %Y the current year.
55
57 # shell script
58 shtool echo -n -e "Enter your name [%B%u%b]: "; read name
59 shtool echo -e "Your Email address might be %u@%h%d"
60 shtool echo -e "The current date is %D-%m-%Y"
61
63 The GNU shtool echo command was originally written by Ralf S.
64 Engelschall <rse@engelschall.com> in 1998 for Website META Language
65 (WML) under the name buildinfo. It was later taken over into GNU
66 shtool.
67
69 shtool(1), echo(1).
70
71
72
7318-Jul-2008 shtool 2.0.8 SHTOOL-ECHO.TMP(1)