ossp-pkg/shtool/sh.echo 1.37 -> 1.38
--- sh.echo 2004/01/01 16:54:20 1.37
+++ sh.echo 2004/02/12 16:06:26 1.38
@@ -1,7 +1,6 @@
##
## echo -- Print string with optional construct expansion
## Copyright (c) 1998-2004 Ralf S. Engelschall <rse@engelschall.com>
-## Originally written for WML as buildinfo
##
## This file is part of shtool and free software; you can redistribute
## it and/or modify it under the terms of the GNU General Public
@@ -20,7 +19,7 @@
##
str_tool="echo"
-str_usage="[-n|--newline] [-e|--expand] [<str> ...]"
+str_usage="[-n|--newline] [-e|--expand] [<string> ...]"
arg_spec="0+"
opt_spec="n.e."
opt_alias="n:newline,e:expand"
@@ -318,3 +317,123 @@
fi
fi
+shtool_exit 0
+
+##
+## manual page
+##
+
+=pod
+
+=head1 NAME
+
+B<shtool echo> - B<GNU shtool> echo(1) extensional command
+
+=head1 SYNOPSIS
+
+B<shtool echo>
+[B<-n>|B<--newline>]
+[B<-e>|B<--expand>]
+I<string>
+
+=head1 DESCRIPTION
+
+B<shtool echo> is an echo(1) style command which prints I<string> to
+F<stdout> and optionally provides special expansion constructs (terminal
+bold mode, environment details, date, etc) and newline control. The
+trick of this command is that it provides a portable B<-n> option and
+hides the gory details needed to find out the environment details under
+option B<-e>.
+
+=head1 OPTIONS
+
+The following command line options are available.
+
+=over 4
+
+=item B<-n>, B<--newline>
+
+By default, output is written to F<stdout> followed by a "newline"
+(ASCII character 0x0a). If option B<-n> is used, this newline character
+is omitted.
+
+=item B<-e>, B<--expand>
+
+If option B<-e> is used, I<string> can contain special "B<%>I<x>"
+constructs which are expanded before the output is written. Currently
+the following constructs are recognized:
+
+=over 4
+
+=item B<%B>
+
+switch terminal mode to bold display mode.
+
+=item B<%b>
+
+switch terminal mode back to normal display mode.
+
+=item B<%u>
+
+the current user name.
+
+=item B<%U>
+
+the current user id (numerical).
+
+=item B<%g>
+
+the current group name.
+
+=item B<%G>
+
+the current group id (numerical).
+
+=item B<%h>
+
+the current hostname (without any domain extension).
+
+=item B<%d>
+
+the current domain name.
+
+=item B<%D>
+
+the current day of the month.
+
+=item B<%M>
+
+the current month (numerical).
+
+=item B<%m>
+
+the current month name.
+
+=item B<%Y>
+
+the current year.
+
+=back
+
+=back
+
+=head1 EXAMPLE
+
+ # 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"
+
+=head1 HISTORY
+
+The B<GNU shtool> B<echo> command was originally written by Ralf S.
+Engelschall E<lt>rse@engelschall.comE<gt> in 1998 for I<Website META
+Language> (WML) under the name B<buildinfo>. It was later taken over
+into B<GNU shtool>.
+
+=head1 SEE ALSO
+
+shtool(1), echo(1).
+
+=cut
+
|
|