groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff-commit] groff/contrib/groffer ChangeLog Makefile.sub ve...


From: Bernd Warken
Subject: [Groff-commit] groff/contrib/groffer ChangeLog Makefile.sub ve...
Date: Mon, 23 Oct 2006 20:28:51 +0000

CVSROOT:        /cvsroot/groff
Module name:    groff
Changes by:     Bernd Warken <bwarken>  06/10/23 20:28:51

Modified files:
        contrib/groffer: ChangeLog Makefile.sub version.sh 
        contrib/groffer/perl: func.pl groffer.man groffer.pl 
        contrib/groffer/shell: README_SH groffer.man groffer.sh 
                               groffer2.sh 

Log message:
        Update groffer 1.0.2

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/groffer/ChangeLog?cvsroot=groff&r1=1.48&r2=1.49
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/groffer/Makefile.sub?cvsroot=groff&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/groffer/version.sh?cvsroot=groff&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/groffer/perl/func.pl?cvsroot=groff&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/groffer/perl/groffer.man?cvsroot=groff&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/groffer/perl/groffer.pl?cvsroot=groff&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/groffer/shell/README_SH?cvsroot=groff&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/groffer/shell/groffer.man?cvsroot=groff&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/groffer/shell/groffer.sh?cvsroot=groff&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/groffer/shell/groffer2.sh?cvsroot=groff&r1=1.1&r2=1.2

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/groff/groff/contrib/groffer/ChangeLog,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- ChangeLog   23 Oct 2006 09:42:24 -0000      1.48
+++ ChangeLog   23 Oct 2006 20:28:51 -0000      1.49
@@ -1,3 +1,36 @@
+2006-10-23  Bernd Warken
+       ________________________________________________________________
+        * release of groffer 1.0.2
+
+       * perl/groffer.pl:
+       - Move all variable declarations out of BEGIN.
+       - Move all `use' commands outside of BEGIN.  Fix the arising
+       errors.
+       - Correct new position of perl/perl_test.pl.
+
+       * perl/func.pl:
+       - version(): Fix the determination of the version of groff.
+       - usage(): Sort it among the functions in this file.
+
+       * perl/groffer.man, shell/groffer.man: Fix string variable
+       Ellipsis.
+
+       * shell/README_SH: Add information on Autobook.
+
+       * shell/groffer.sh:
+       - Extent simple shell tests by testing on support for functions.
+       Test standard shell on function support.  Add error reports on
+       shell tests.
+       - Set unset variables LANG LC_ALL LC_MESSAGES LC_CTYPES LANGUAGES
+       to `C', according to Autobook, ch. 22.
+       - Remove option `-e' from `sed'.
+
+       * shell/groffer2.sh:
+       - Add test on directory in man path find.
+       - Add Bourne compatibility for zsh shell.
+       - Replace `echo -n ""' by `:'.
+       - Remove -e option from sed.
+
 2006-10-23  Werner Lemberg
 
        * perl_test.pl: Moved to...

Index: Makefile.sub
===================================================================
RCS file: /cvsroot/groff/groff/contrib/groffer/Makefile.sub,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- Makefile.sub        23 Oct 2006 09:42:24 -0000      1.21
+++ Makefile.sub        23 Oct 2006 20:28:51 -0000      1.22
@@ -105,7 +105,7 @@
 
 uninstall_sub:
        $(RM) $(DESTDIR)$(bindir)/groffer
-       for f in $(GROFFER_PERL_) $(GROFFER_SHELL_); do \
+       for f in $(GROFFER_PERL_) $(GROFFER_SHELL_) version.sh; do \
           $(RM) $(DESTDIR)$(groffer_dir)/$$f; \
         done
        -rmdir $(DESTDIR)$(libdir)/groff/groffer

Index: version.sh
===================================================================
RCS file: /cvsroot/groff/groff/contrib/groffer/version.sh,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- version.sh  14 Oct 2006 13:45:32 -0000      1.10
+++ version.sh  23 Oct 2006 20:28:51 -0000      1.11
@@ -32,8 +32,8 @@
 export _PROGRAM_VERSION;
 export _LAST_UPDATE;
 
-_PROGRAM_VERSION='1.0.1';
-_LAST_UPDATE='14 Oct 2006';
+_PROGRAM_VERSION='1.0.2';
+_LAST_UPDATE='23 Oct 2006';
 
 # this setting of the groff version is only used before make is run,
 # otherwise @VERSION@ will set it, see groffer.sh.

Index: perl/func.pl
===================================================================
RCS file: /cvsroot/groff/groff/contrib/groffer/perl/func.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- perl/func.pl        14 Oct 2006 13:45:32 -0000      1.2
+++ perl/func.pl        23 Oct 2006 20:28:51 -0000      1.3
@@ -8,7 +8,7 @@
 # Copyright (C) 2006 Free Software Foundation, Inc.
 # Written by Bernd Warken.
 
-# Last update: 11 Oct 2006
+# Last update: 17 Oct 2006
 
 # This file is part of `groffer', which is part of `groff'.
 
@@ -502,12 +502,112 @@
 
 
 ##########
+# usage()
+#
+# Print usage information for --help.
+#
+sub usage {
+  print "\n";
+  &version();
+  print <<EOF;
+
+Usage: groffer [option]... [filespec]...
+
+Display roff files, standard input, and/or Unix manual pages with an X
+Window viewer or in several text modes.  All input is decompressed
+on-the-fly with all formats that gzip can handle.
+
+"filespec" is one of
+  "filename"       name of a readable file
+  "-"              for standard input
+  "man:name(n)"    man page "name" in section "n"
+  "man:name.n"     man page "name" in section "n"
+  "man:name"       man page "name" in first section found
+  "name(n)"        man page "name" in section "n"
+  "name.n"         man page "name" in section "n"
+  "n name"         man page "name" in section "n"
+  "name"           man page "name" in first section found
+where `section' is a single character out of [1-9on], optionally followed
+by some more letters that are called the `extension'.
+
+-h --help         print this usage message.
+-T --device=name  pass to groff using output device "name".
+-v --version      print version information.
+-V                display the groff execution pipe instead of formatting.
+-X                display with "gxditview" using groff -X.
+-Z --ditroff --intermediate-output
+                  generate groff intermediate output without
+                  post-processing and viewing, like groff -Z.
+All other short options are interpreted as "groff" formatting options.
+
+The most important groffer long options are
+
+--apropos=name    start man's "apropos" program for "name".
+--apropos-data=name
+                  "apropos" for "name" in man's data sections 4, 5, 7.
+--apropos-devel=name
+                  "apropos" for "name" in development sections 2, 3, 9.
+--apropos-progs=name
+                  "apropos" for "name" in man's program sections 1, 6, 8.
+--auto            choose mode automatically from the default mode list.
+--default         reset all options to the default value.
+--default-modes=mode1,mode2,...
+                  set sequence of automatically tried modes.
+--dvi             display in a viewer for TeX device independent format.
+--dvi-viewer=prog choose the viewer program for dvi mode.
+--groff           process like groff, disable viewing features.
+--help            display this helping output.
+--html            display in a web browser.
+--html-viewer=program
+                  choose the web browser for html mode.
+--man             check file parameters first whether they are man pages.
+--mode=auto|dvi|groff|html|pdf|ps|source|text|tty|www|x|X
+                  choose display mode.
+--no-man          disable man-page facility.
+--no-special      disable --all, --apropos*, and --whatis
+--pager=program   preset the paging program for tty mode.
+--pdf             display in a PDF viewer.
+--pdf-viewer=prog choose the viewer program for pdf mode.
+--ps              display in a Postscript viewer.
+--ps-viewer=prog  choose the viewer program for ps mode.
+--source          output as roff source.
+--text            output in a text device without a pager.
+--to-stdout       output the content of the mode file without display.
+--tty             display with a pager on text terminal even when in X.
+--tty-viewer=prog select a pager for tty mode; same as --pager.
+--whatis          display the file name and description of man pages
+--www             same as --html.
+--www-viewer=prog same as --html-viewer
+--x --X           display with "gxditview" using an X* device.
+--x-viewer=prog   choose viewer program for x mode (X mode).
+--X-viewer=prog   same as "--xviewer".
+
+The usual X Windows toolkit options transformed into GNU long options:
+--background=color, --bd=size, --bg=color, --bordercolor=color,
+--borderwidth=size, --bw=size, --display=Xdisplay, --fg=color,
+--fn=font, --font=font, --foreground=color, --geometry=geom, --iconic,
+--resolution=dpi, --rv, --title=text, --xrm=resource
+
+Long options of GNU "man":
+--all, --ascii, --ditroff, --extension=suffix, --locale=language,
+--local-file=name, --location, --manpath=dir1:dir2:...,
+--sections=s1:s2:..., --systems=s1,s2,..., --where, ...
+
+Development options that are not useful for normal usage:
+--debug, --debug-filenames, --debug-keep, --debug-params,
+--debug-tmpdir, --do-nothing, --print=text
+
+EOF
+} # usage()
+
+
+##########
 # version()
 #
 # Get version information from version.sh and print a text with this.
 #
 sub version {
-  my $Groff_Version;
+  my $groff_version;
   my $program_version = '';
   my $last_update = '';
   my $groff_version_preset = '';
@@ -535,12 +635,16 @@
   }
   close $fh;
 
-  $Groff_Version = "$groff_version_preset" unless $Groff_Version;
+  if ($main::Groff_Version) {
+    $groff_version = $main::Groff_Version;
+  } else {
+    $groff_version = $groff_version_preset;
+  }
   my $year = $last_update;
   $year =~ s/^.* //;
   print <<EOF;
 groffer $program_version of $last_update (Perl version)
-is part of groff version $Groff_Version.
+is part of groff version $groff_version.
 Copyright (C) $year Free Software Foundation, Inc.
 GNU groff and groffer come with ABSOLUTELY NO WARRANTY.
 You may redistribute copies of groff and its subprograms
@@ -673,106 +777,6 @@
 
 
 ##########
-# usage()
-#
-# Print usage information for --help.
-#
-sub usage {
-  print "\n";
-  &version();
-  print <<EOF;
-
-Usage: groffer [option]... [filespec]...
-
-Display roff files, standard input, and/or Unix manual pages with a X
-Window viewer or in several text modes.  All input is decompressed
-on-the-fly with all formats that gzip can handle.
-
-"filespec" is one of
-  "filename"       name of a readable file
-  "-"              for standard input
-  "man:name(n)"    man page "name" in section "n"
-  "man:name.n"     man page "name" in section "n"
-  "man:name"       man page "name" in first section found
-  "name(n)"        man page "name" in section "n"
-  "name.n"         man page "name" in section "n"
-  "n name"         man page "name" in section "n"
-  "name"           man page "name" in first section found
-where `section' is a single character out of [1-9on], optionally followed
-by some more letters that are called the `extension'.
-
--h --help         print this usage message.
--T --device=name  pass to groff using output device "name".
--v --version      print version information.
--V                display the groff execution pipe instead of formatting.
--X                display with "gxditview" using groff -X.
--Z --ditroff --intermediate-output
-                  generate groff intermediate output without
-                  post-processing and viewing, like groff -Z.
-All other short options are interpreted as "groff" formatting options.
-
-The most important groffer long options are
-
---apropos=name    start man's "apropos" program for "name".
---apropos-data=name
-                  "apropos" for "name" in man's data sections 4, 5, 7.
---apropos-devel=name
-                  "apropos" for "name" in development sections 2, 3, 9.
---apropos-progs=name
-                  "apropos" for "name" in man's program sections 1, 6, 8.
---auto            choose mode automatically from the default mode list.
---default         reset all options to the default value.
---default-modes=mode1,mode2,...
-                  set sequence of automatically tried modes.
---dvi             display in a viewer for TeX device independent format.
---dvi-viewer=prog choose the viewer program for dvi mode.
---groff           process like groff, disable viewing features.
---help            display this helping output.
---html            display in a web browser.
---html-viewer=program
-                  choose the web browser for html mode.
---man             check file parameters first whether they are man pages.
---mode=auto|dvi|groff|html|pdf|ps|source|text|tty|www|x|X
-                  choose display mode.
---no-man          disable man-page facility.
---no-special      disable --all, --apropos*, and --whatis
---pager=program   preset the paging program for tty mode.
---pdf             display in a PDF viewer.
---pdf-viewer=prog choose the viewer program for pdf mode.
---ps              display in a Postscript viewer.
---ps-viewer=prog  choose the viewer program for ps mode.
---source          output as roff source.
---text            output in a text device without a pager.
---to-stdout       output the content of the mode file without display.
---tty             display with a pager on text terminal even when in X.
---tty-viewer=prog select a pager for tty mode; same as --pager.
---whatis          display the file name and description of man pages
---www             same as --html.
---www-viewer=prog same as --html-viewer
---x --X           display with "gxditview" using an X* device.
---x-viewer=prog   choose viewer program for x mode (X mode).
---X-viewer=prog   same as "--xviewer".
-
-The usual X Windows toolkit options transformed into GNU long options:
---background=color, --bd=size, --bg=color, --bordercolor=color,
---borderwidth=size, --bw=size, --display=Xdisplay, --fg=color,
---fn=font, --font=font, --foreground=color, --geometry=geom, --iconic,
---resolution=dpi, --rv, --title=text, --xrm=resource
-
-Long options of GNU "man":
---all, --ascii, --ditroff, --extension=suffix, --locale=language,
---local-file=name, --location, --manpath=dir1:dir2:...,
---sections=s1:s2:..., --systems=s1,s2,..., --where, ...
-
-Development options that are not useful for normal usage:
---debug, --debug-filenames, --debug-keep, --debug-params,
---debug-tmpdir, --do-nothing, --print=text
-
-EOF
-} # usage()
-
-
-##########
 # wait()
 #
 # stop for checking temp files, etc.

Index: perl/groffer.man
===================================================================
RCS file: /cvsroot/groff/groff/contrib/groffer/perl/groffer.man,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- perl/groffer.man    14 Oct 2006 05:59:54 -0000      1.1
+++ perl/groffer.man    23 Oct 2006 20:28:51 -0000      1.2
@@ -77,7 +77,7 @@
 .  ftr CB CW
 .\}
 .
-.ds Ellipsis ".\|.\|.\""
+.ds Ellipsis "\&.\|.\|.\""
 .
 .\" --------------------------------------------------------------------
 .\" setup for the macro definitions below
@@ -663,9 +663,9 @@
 .
 .ad l
 .Synopsis groffer
-.RI [ option... ]
+.RI [ option \*[Ellipsis]]
 .Opt_[--]
-.RI [ "\%filespec" "\*[Ellipsis]]"
+.RI [ \%filespec \*[Ellipsis]]
 ./Synopsis
 .
 .Synopsis groffer

Index: perl/groffer.pl
===================================================================
RCS file: /cvsroot/groff/groff/contrib/groffer/perl/groffer.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- perl/groffer.pl     14 Oct 2006 13:45:32 -0000      1.2
+++ perl/groffer.pl     23 Oct 2006 20:28:51 -0000      1.3
@@ -2,13 +2,13 @@
 
 # groffer - display groff files
 
-# Source file position: <groff-source>/contrib/groffer/perl/groffer.sh
+# Source file position: <groff-source>/contrib/groffer/perl/groffer.pl
 # Installed position: <prefix>/bin/groffer
 
 # Copyright (C) 2006 Free Software Foundation, Inc.
 # Written by Bernd Warken.
 
-# Last update: 14 Oct 2006
+# Last update: 23 Oct 2006
 
 # This file is part of `groffer', which is part of `groff'.
 
@@ -30,70 +30,71 @@
 
 ########################################################################
 
-BEGIN {
-  use strict;
-  use warnings;
-  #use diagnostics;
+use strict;
+use warnings;
+#use diagnostics;
 
-  # temporary dir and files
-  use File::Temp qw/ tempfile tempdir /;
+# temporary dir and files
+use File::Temp qw/ tempfile tempdir /;
 
-  # needed for temporary dir
-  use File::Spec;
+# needed for temporary dir
+use File::Spec;
 
-  # for `copy' and `move'
-  use File::Copy;
+# for `copy' and `move'
+use File::Copy;
 
-  # for fileparse, dirname and basename
-  use File::Basename;
+# for fileparse, dirname and basename
+use File::Basename;
 
-  # current working directory
-  use Cwd;
+# current working directory
+use Cwd;
 
-  # $Bin is the directory where this script is located
-  use FindBin;
-}
+# $Bin is the directory where this script is located
+use FindBin;
 
 
 ########################################################################
 # system variables and exported variables
 ########################################################################
 
-BEGIN {
-  our $Dev_Null = File::Spec->devnull();
+our $Dev_Null;
+our $Umask;
+our @Path;
+our $Start_Dir;
+
+our $tmpdir = '';
+our ($fh_cat, $tmp_cat);
+our ($fh_stdin, $tmp_stdin);
+
+our @Addopts_Groff;
+our %Debug;
+our %Opt;
+
+our $Has_Compression;
+our $Has_bzip;
+
+our $Output_File_Name;
+
+our $Apropos_Prog;
+our $Filespec_Arg;
+our $Filespec_Is_Man;
+our $Macro_Pkg;
+our $Manspec;
+our $No_Filespecs;
+our $Special_Filespec;
+our $Special_Setup;
+
+our %Man;
 
-  our $Umask = umask 077;
+BEGIN {
+  $Dev_Null = File::Spec->devnull();
 
-  our @Path = File::Spec->path();
+  $Umask = umask 077;
 
-  our $Start_Dir = getcwd;
+  $Start_Dir = getcwd;
 
   # flush after each print or write command
   $| = 1;
-
-  our $tmpdir = '';
-  our ($fh_cat, $tmp_cat);
-  our ($fh_stdin, $tmp_stdin);
-
-  our @Addopts_Groff;
-  our %Debug;
-  our %Opt;
-
-  our $Has_Compression;
-  our $Has_bzip;
-
-  our $Output_File_Name;
-
-  our $Apropos_Prog;
-  our $Filespec_Arg;
-  our $Filespec_Is_Man;
-  our $Macro_Pkg;
-  our $Manspec;
-  our $No_Filespecs;
-  our $Special_Filespec;
-  our $Special_Setup;
-
-  our %Man;
 }
 
 
@@ -101,11 +102,11 @@
 # read-only variables with double-@ construct
 ########################################################################
 
+our $File_split_env_sh;
+our $File_version_sh;
+our $Groff_Version;
 
 BEGIN {
-  our $File_split_env_sh;
-  our $File_version_sh;
-
   {
     my $before_make;           # script before run of `make'
     {
@@ -125,7 +126,7 @@
       $at_at{'G'} = '';
       $at_at{'LIBDIR'} = '';
       $groffer_libdir = $groffer_perl_dir;
-      $file_perl_test_pl = File::Spec->catfile($groffer_top_dir,
+      $file_perl_test_pl = File::Spec->catfile($groffer_perl_dir,
                                               'perl_test.pl');
       $File_version_sh = File::Spec->catfile($groffer_top_dir, 'version.sh');
       $Groff_Version = '';
@@ -156,7 +157,7 @@
     require 'func.pl';
     require 'man.pl';
 
-    @Path = &path_uniq(@Path);
+    @Path = &path_uniq( File::Spec->path() );
 
     if ( &where_is_prog('gzip') ) {
       $Has_Compression = 1;

Index: shell/README_SH
===================================================================
RCS file: /cvsroot/groff/groff/contrib/groffer/shell/README_SH,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- shell/README_SH     14 Oct 2006 05:59:54 -0000      1.1
+++ shell/README_SH     23 Oct 2006 20:28:51 -0000      1.2
@@ -156,6 +156,8 @@
 name.  These quasi-local variables are unset before each return of the
 function.
 
+For shell compatiblity, see also Autobook, chapter 22.
+
 The `groffer' scripts were tested under the shells `ash', `bash',
 `bash-minimal', `dash', 'ksh', `mksh', `pdksh', 'posh', and `zsh'
 without problems in Linux Debian.  A shell can be tested by the
@@ -266,7 +268,7 @@
 
 ####### License
 
-Last update: 28 Jul 2006
+Last update: 22 Oct 2006
 
 Copyright (C) 2003,2004,2005,2006 Free Software Foundation, Inc.
 Written by Bernd Warken

Index: shell/groffer.man
===================================================================
RCS file: /cvsroot/groff/groff/contrib/groffer/shell/groffer.man,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- shell/groffer.man   14 Oct 2006 05:59:54 -0000      1.1
+++ shell/groffer.man   23 Oct 2006 20:28:51 -0000      1.2
@@ -77,7 +77,7 @@
 .  ftr CB CW
 .\}
 .
-.ds Ellipsis ".\|.\|.\""
+.ds Ellipsis "\&.\|.\|.\""
 .
 .\" --------------------------------------------------------------------
 .\" setup for the macro definitions below
@@ -663,9 +663,9 @@
 .
 .ad l
 .Synopsis groffer
-.RI [ option... ]
+.RI [ option \*[Ellipsis]]
 .Opt_[--]
-.RI [ "\%filespec" "\*[Ellipsis]]"
+.RI [ \%filespec \*[Ellipsis]]
 ./Synopsis
 .
 .Synopsis groffer

Index: shell/groffer.sh
===================================================================
RCS file: /cvsroot/groff/groff/contrib/groffer/shell/groffer.sh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- shell/groffer.sh    14 Oct 2006 05:59:54 -0000      1.1
+++ shell/groffer.sh    23 Oct 2006 20:28:51 -0000      1.2
@@ -9,7 +9,7 @@
 # Free Software Foundation, Inc.
 # Written by Bernd Warken
 
-# Last update: 5 Oct 2006
+# Last update: 22 Oct 2006
 
 # This file is part of `groffer', which is part of `groff'.
 
@@ -163,12 +163,23 @@
 fi;
 
 # Test of sed program
-if test _"$(echo red | sed -e 's/r/s/')"_ != _sed_
+if test _"$(echo red | sed 's/r/s/')"_ != _sed_
 then
   echo 'The sed program did not work.' >&2;
   exit "${_ERROR}";
 fi;
 
+# for some systems it is necessary to set some unset variables to `C'
+# according to Autobook, ch. 22
+for var in LANG LC_ALL LC_MESSAGES LC_CTYPES LANGUAGES
+do
+  if eval test _"\${$var+set}"_ = _set_
+  then
+    eval ${var}='C';
+    eval export ${var};
+  fi;
+done;
+
 
 ########################### configuration
 
@@ -179,7 +190,7 @@
   then
     o="";                      # $o means groffer option
     # use "" quotes because of ksh and posh
-    eval "$(cat "$f" | sed -n -e '
+    eval "$(cat "$f" | sed -n '
 # Ignore comments
 /^['"${_SP}${_TAB}"']*#/d
 # Delete leading and final space
@@ -200,7 +211,7 @@
 ')"
 
     # Remove leading space
-    o="$(echo "$o" | sed -e 's/^ *//')";
+    o="$(echo "$o" | sed 's/^ *//')";
     if test _"${o}"_ != __
     then
       if test _"{GROFFER_OPT}"_ = __
@@ -226,6 +237,13 @@
 
 export _SHELL;
 
+supports_func=no;
+foo() { echo bar; } 2>${_NULL_DEV};
+if test _"$(foo)"_ = _bar_
+then
+  supports_func=yes;
+fi;
+
 # use "``" instead of "$()" for using the case ")" construct
 # do not use "" quotes because of ksh
 _SHELL=`
@@ -251,7 +269,7 @@
         ;;
       --shell=*|--sh=*|--she=*|--shel=*)
         # delete up to first "=" character
-        s="$(echo x"$1" | sed -e 's/^x[^=]*=//')";
+        s="$(echo x"$1" | sed 's/^x[^=]*=//')";
         ;;
       *)
         shift;
@@ -278,21 +296,37 @@
         do
           if test _"$i"_ = __
           then
+            if test _"${supports_func}"_ = _yes_
+            then
             # use the empty argument as the default shell
-            echo empty;
+              echo 'standard shell';
             break;
           else
+              echo groffer: standard shell does not support functions. >&2;
+              continue;
+            fi;
+          else
             # test $i on being a shell program;
             # use this kind of quoting for posh
             if test _"$(eval "$i -c 'echo ok'" 2>${_NULL_DEV})"_ = _ok_ >&2
             then
-              # shell found
+              # test whether shell supports functions
+              if eval "$i -c 'foo () { exit 0; }; foo'" 2>${_NULL_DEV}
+              then
+                # shell with function support found
               cat <<EOF
 ${i}
 EOF
               break;
             else
+                # if not being a shell with function support go on searching
+                echo groffer: argument $i is not a shell \
+with function support. >&2
+                continue;
+              fi;
+            else
               # if not being a shell go on searching
+              echo groffer: argument $i is not a shell. >&2
               continue;
             fi;
           fi;
@@ -313,9 +347,11 @@
 
 if test _"${_SHELL}"_ = __
 then
-  for s in ksh ash dash pdksh zsh posh
+  # shell sorted by speed, bash is very slow
+  for s in ksh ash dash pdksh zsh posh sh bash
   do
-    if test _"$(eval "$s -c 'echo ok'" 2>${_NULL_DEV})"_ = _ok_ >&2
+    # test on shell with function support
+    if eval "$s -c 'foo () { exit 0; }; foo'" 2>${_NULL_DEV}
     then
       _SHELL="$s";
       break;
@@ -326,7 +362,7 @@
 
 ########################### start groffer2.sh
 
-if test _"${_SHELL}"_ = _empty_
+if test _"${_SHELL}"_ = _'standard shell'_
 then
   _SHELL='';
 fi;
@@ -334,8 +370,15 @@
 if test _"${_SHELL}"_ = __
 then
   # no shell found, so start groffer2.sh normally
+  if test _${supports_func}_ = _yes_
+  then
   eval . "'${_GROFFER2_SH}'" '"$@"';
   exit;
+  else
+    echo groffer: standard shell does not support functions; no shell works.\
+Get some free working shell such as bash. >&2
+    exit "${_ERROR}";
+  fi;
 else
   # start groffer2.sh with the found $_SHELL
   # do not quote $_SHELL to allow arguments

Index: shell/groffer2.sh
===================================================================
RCS file: /cvsroot/groff/groff/contrib/groffer/shell/groffer2.sh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- shell/groffer2.sh   14 Oct 2006 05:59:54 -0000      1.1
+++ shell/groffer2.sh   23 Oct 2006 20:28:51 -0000      1.2
@@ -12,7 +12,7 @@
 # Free Software Foundation, Inc.
 # Written by Bernd Warken
 
-# Last update: 5 Oct 2006
+# Last update: 22 Oct 2006
 
 # This file is part of `groffer', which is part of `groff'.
 
@@ -37,6 +37,12 @@
 #             Test of rudimentary shell functionality
 ########################################################################
 
+# Zsh is not Bourne compatible without the following:
+if test -n "$ZSH_VERSION"; then
+  emulate sh
+  NULLCMD=:
+fi
+
 
 ########################################################################
 # Test of `unset'
@@ -93,8 +99,8 @@
 # Test of sed program; test in groffer.sh is not valid here.
 #
 if test _"$(echo xTesTx \
-           | sed -n -e 's/^.\([Tt]e*x*sTT*\).*$/\1/p' \
-           | sed -e 's|T|t|g')"_ != _test_
+           | sed -n 's/^.\([Tt]e*x*sTT*\).*$/\1/p' \
+           | sed 's|T|t|g')"_ != _test_
 then
   echo 'The sed program did not work.' >&2;
   exit "${_ERROR}";
@@ -244,9 +250,9 @@
       ;;
     --d*-*)
       # before `-'
-      b="$(echo x"$i" | sed -e 's/^x--\([^-]*\)-.*$/\1/')";
+      b="$(echo x"$i" | sed 's/^x--\([^-]*\)-.*$/\1/')";
       # after `-'
-      a="$(echo x"$i" | sed -e 's/^x--[^-]*-\(.*\)$/\1/')";
+      a="$(echo x"$i" | sed 's/^x--[^-]*-\(.*\)$/\1/')";
       ;;
     *)
       continue;
@@ -265,7 +271,7 @@
         ;;
       esac;
       # extract whole word of double abbreviation
-      s="$(cat <<EOF | sed -n -e 's/^.* \(--'"$b"'[^ -]*-'"$a"'[^ ]*\) .*/\1/p'
+      s="$(cat <<EOF | sed -n 's/^.* \(--'"$b"'[^ -]*-'"$a"'[^ ]*\) .*/\1/p'
 $d
 EOF
 )"
@@ -712,7 +718,7 @@
 _PDF_HAS_PS2PDF='no';
 
 # option -r for soelim
-if echo -n '' | soelim -r 2>${_NULL_DEV} >${_NULL_DEV}
+if : | soelim -r 2>${_NULL_DEV} >${_NULL_DEV}
 then
   _SOELIM_R='-r';
 else
@@ -990,7 +996,7 @@
     if obj _NO_FILESPECS is_yes
     then
       to_tmp_line '.SH no filespec';
-      eval "${_APROPOS_PROG}" | sed -e 's/^/\\\&/' >>"${_TMP_CAT}";
+      eval "${_APROPOS_PROG}" | sed 's/^/\\\&/' >>"${_TMP_CAT}";
       eval "${return_ok}";
     fi;
     eval to_tmp_line \
@@ -1002,23 +1008,23 @@
       then
         s='^.*(..*).*$';
       else
-        s='^.*(['"$(echo1 "${_OPT_SECTIONS}" | sed -e 's/://g')"']';
+        s='^.*(['"$(echo1 "${_OPT_SECTIONS}" | sed 's/://g')"']';
       fi;
     else
       s='^.*(['"${_APROPOS_SECTIONS}"']';
     fi;
 ### apropos_filespec()
-    af_filespec="$(echo1 "${_FILESPEC_ARG}" | sed -e '
+    af_filespec="$(echo1 "${_FILESPEC_ARG}" | sed '
 s,/,\\/,g
 s/\./\\./g
 ')";
     eval "${_APROPOS_PROG}" "'${_FILESPEC_ARG}'" | \
-      sed -n -e '
+      sed -n '
 /^'"${af_filespec}"': /s/^\(.*\)$/\\\&\1/p
 /'"$s"'/p
 ' | \
       sort |\
-      sed -e '
+      sed '
 s/^\(.*(..*).*\)  *-  *\(.*\)$/\.br\n\.TP 15\n\.BR \"\1\"\n\\\&\2/
 ' >>"${_TMP_CAT}";
     eval ${_UNSET} af_filespec;
@@ -1092,7 +1098,7 @@
   case "${bn_name}" in
     */)
       # delete all final slashes
-      bn_name="$(echo1 "${bn_name}" | sed -e 's|//*$||')";
+      bn_name="$(echo1 "${bn_name}" | sed 's|//*$||')";
       exit_test;
       ;;
   esac;
@@ -1107,7 +1113,7 @@
       ;;
     */*)
       # delete everything before and including the last slash `/'.
-      echo1 "${bn_name}" | sed -e 's|^.*//*\([^/]*\)$|\1|';
+      echo1 "${bn_name}" | sed 's|^.*//*\([^/]*\)$|\1|';
       ;;
     *)
       obj bn_name echo1;
@@ -1261,12 +1267,12 @@
 {
   func_check dir_name_chop = 1 "$@";
   # replace all multiple slashes by a single slash `/'.
-  dc_res="$(echo1 "$1" | sed -e 's|///*|/|g')";
+  dc_res="$(echo1 "$1" | sed 's|///*|/|g')";
   exit_test;
   case "${dc_res}" in
   ?*/)
     # remove trailing slash '/';
-    echo1 "${dc_res}" | sed -e 's|/$||';
+    echo1 "${dc_res}" | sed 's|/$||';
     ;;
   *)
     obj dc_res echo1
@@ -1442,7 +1448,7 @@
       ;;
     *!*)
       # split at first bang `!'.
-      _FUNC_STACK="$(echo1 "${_FUNC_STACK}" | sed -e 's/^[^!]*!//')";
+      _FUNC_STACK="$(echo1 "${_FUNC_STACK}" | sed 's/^[^!]*!//')";
       exit_test;
       ;;
     *)
@@ -1478,7 +1484,7 @@
     case "$1" in
     *'!'*)
       # remove all bangs `!'.
-      fp_element="$(echo1 "$1" | sed -e 's/!//g')";
+      fp_element="$(echo1 "$1" | sed 's/!//g')";
       exit_test;
       ;;
     *)
@@ -1708,7 +1714,7 @@
 is_integer()
 {
   func_check is_integer '=' 1 "$@";
-  if is_equal "$(echo1 "$1" | sed -n -e '
+  if is_equal "$(echo1 "$1" | sed -n '
 s/^[0-9][0-9]*$/ok/p
 s/^[-+][0-9][0-9]*$/ok/p
 ')" 'ok'
@@ -2028,7 +2034,7 @@
       # escape each single quote by replacing each
       # "'" (squote) by "'\''" (squote bslash squote squote);
       # note that the backslash must be doubled in the following `sed'
-      la_element="$(echo1 "${la_s}" | sed -e 's/'"${_SQ}"'/&\\&&/g')";
+      la_element="$(echo1 "${la_s}" | sed 's/'"${_SQ}"'/&\\&&/g')";
       exit_test;
       ;;
     '')
@@ -2150,10 +2156,10 @@
     --) break; ;;
     --*=*)
       # delete leading '--';
-      lfc_with_equal="$(echo1 "${lfc_arg}" | sed -e 's/^--//')";
+      lfc_with_equal="$(echo1 "${lfc_arg}" | sed 's/^--//')";
       # extract option by deleting from the first '=' to the end
       lfc_abbrev="$(echo1 "${lfc_with_equal}" | \
-                    sed -e 's/^\([^=]*\)=.*$/\1/')";
+                    sed 's/^\([^=]*\)=.*$/\1/')";
       obj_from_output lfc_opt \
         list_single_from_abbrev lfc_long_a "${lfc_abbrev}";
       if obj lfc_opt is_empty
@@ -2161,7 +2167,7 @@
         error_user "--${lfc_abbrev} is not an option.";
       else
         # get the option argument by deleting up to first `='
-        lfc_optarg="$(echo1 "${lfc_with_equal}" | sed -e 's/^[^=]*=//')";
+        lfc_optarg="$(echo1 "${lfc_with_equal}" | sed 's/^[^=]*=//')";
         exit_test;
         list_append lfc_result "--${lfc_opt}" "${lfc_optarg}";
         continue;
@@ -2170,7 +2176,7 @@
       ;;
     --*)
       # delete leading '--';
-      lfc_abbrev="$(echo1 "${lfc_arg}" | sed -e 's/^--//')";
+      lfc_abbrev="$(echo1 "${lfc_arg}" | sed 's/^--//')";
       if list_has lfc_long_n "${lfc_abbrev}"
       then
         lfc_opt="${lfc_abbrev}";
@@ -2212,14 +2218,14 @@
       ;;
     -?*)                       # short option (cluster)
       # delete leading `-';
-      lfc_rest="$(echo1 "${lfc_arg}" | sed -e 's/^-//')";
+      lfc_rest="$(echo1 "${lfc_arg}" | sed 's/^-//')";
       exit_test;
       while obj lfc_rest is_not_empty
       do
         # get next short option from cluster (first char of $lfc_rest)
-        lfc_optchar="$(echo1 "${lfc_rest}" | sed -e 's/^\(.\).*$/\1/')";
+        lfc_optchar="$(echo1 "${lfc_rest}" | sed 's/^\(.\).*$/\1/')";
         # remove first character from ${lfc_rest};
-        lfc_rest="$(echo1 "${lfc_rest}" | sed -e 's/^.//')";
+        lfc_rest="$(echo1 "${lfc_rest}" | sed 's/^.//')";
         exit_test;
         if list_has lfc_short_n "${lfc_optchar}"
         then
@@ -2386,13 +2392,13 @@
       ;;
     --*=*)
       # delete leading '--';
-      lfcwm_with_equal="$(echo1 "${lfcwm_arg}" | sed -e 's/^--//')";
+      lfcwm_with_equal="$(echo1 "${lfcwm_arg}" | sed 's/^--//')";
       # extract option by deleting from the first '=' to the end
       lfcwm_abbrev="$(echo1 "${lfcwm_with_equal}" | \
-                    sed -e 's/^\([^=]*\)=.*$/\1/')";
+                    sed 's/^\([^=]*\)=.*$/\1/')";
       # extract option argument by deleting up to the first '='
       lfcwm_optarg="$(echo1 "${lfcwm_with_equal}" | \
-                    sed -e 's/^[^=]*=\(.*\)$/\1/')";
+                    sed 's/^[^=]*=\(.*\)$/\1/')";
 ### list_from_cmdline_with_minus()
       if list_has lfcwm_long_a "${lfcwm_abbrev}"
       then
@@ -2406,7 +2412,7 @@
       ;;
     --*)
       # delete leading '--';
-      lfcwm_abbrev="$(echo1 "${lfcwm_arg}" | sed -e 's/^--//')";
+      lfcwm_abbrev="$(echo1 "${lfcwm_arg}" | sed 's/^--//')";
       if list_has lfcwm_long_both "${lfcwm_abbrev}"
       then
         lfcwm_opt="${lfcwm_abbrev}";
@@ -2431,13 +2437,13 @@
       ;;
     -?*)                       # short option (cluster)
       # delete leading '-';
-      lfcwm_rest="$(echo1 "${lfcwm_arg}" | sed -e 's/^-//')";
+      lfcwm_rest="$(echo1 "${lfcwm_arg}" | sed 's/^-//')";
       while obj lfcwm_rest is_not_empty
       do
         # get next short option from cluster (first char of $lfcwm_rest)
-        lfcwm_optchar="$(echo1 "${lfcwm_rest}" | sed -e 's/^\(.\).*$/\1/')";
+        lfcwm_optchar="$(echo1 "${lfcwm_rest}" | sed 's/^\(.\).*$/\1/')";
         # remove first character from ${lfcwm_rest};
-        lfcwm_rest="$(echo1 "${lfcwm_rest}" | sed -e 's/^.//')";
+        lfcwm_rest="$(echo1 "${lfcwm_rest}" | sed 's/^.//')";
         if list_has lfcwm_short_n "${lfcwm_optchar}"
         then
           list_append lfcwm_result "-${lfcwm_optchar}";
@@ -2542,7 +2548,7 @@
     error "_search_abbrev(): abbreviation argument is empty.";
   fi;
 
-  _sa_case="$(echo1 "${_sa_abbrev}" | sed -e 's/-/\*-/g')";
+  _sa_case="$(echo1 "${_sa_abbrev}" | sed 's/-/\*-/g')";
   _sa_opt='';
   case " ${_sa_list}" in
   *\ \'${_sa_case}*)           # list has the abbreviation
@@ -2629,7 +2635,7 @@
   then
     eval "${return_bad}";
   fi;
-  lff_n="$(wc -l "$2" | eval sed -e "'s/^[ ${_TAB}]*\([0-9]\+\).*$/\1/'")";
+  lff_n="$(wc -l "$2" | eval sed "'s/^[ ${_TAB}]*\([0-9]\+\).*$/\1/'")";
   eval "$1"="''";
   if obj lff_n is_equal 0
   then
@@ -2639,7 +2645,7 @@
   while obj lff_i is_not_equal "${lff_n}"
   do
     lff_i="$(expr "${lff_i}" + 1)";
-    list_append "$1" "$(eval sed -n -e "'${lff_i}p
+    list_append "$1" "$(eval sed -n "'${lff_i}p
 ${lff_i}q'" "'$2'")";
   done;
   eval "${_UNSET}" lff_i;
@@ -2685,16 +2691,16 @@
     *${lfs_splitter}*)
       case "${lfs_splitter}" in
       /)
-        lfs_elt="$(echo1 ${lfs_rest} | sed -e \
+        lfs_elt="$(echo1 ${lfs_rest} | sed \
           's|^\([^'"${lfs_splitter}"']*\)'"${lfs_splitter}"'.*|\1|')";
-        lfs_rest="$(echo1 ${lfs_rest} | sed -e \
+        lfs_rest="$(echo1 ${lfs_rest} | sed \
           's|^[^'"${lfs_splitter}"']*'"${lfs_splitter}"'\(.*\)$|\1|')";
         ;;
       *)
 ### list_from_split()
-        lfs_elt="$(echo1 ${lfs_rest} | sed -e \
+        lfs_elt="$(echo1 ${lfs_rest} | sed \
           's/^\([^'"${lfs_splitter}"']*\)'"${lfs_splitter}"'.*/\1/')";
-        lfs_rest="$(echo1 ${lfs_rest} | sed -e \
+        lfs_rest="$(echo1 ${lfs_rest} | sed \
           's/^[^'"${lfs_splitter}"']*'"${lfs_splitter}"'\(.*\)$/\1/')";
         ;;
       esac;
@@ -2777,7 +2783,7 @@
   fi;
   case "$2" in
   \'*)
-    lha_element="$(echo1 "$2" | sed -e 's/'"${_SQ}"'$//')";
+    lha_element="$(echo1 "$2" | sed 's/'"${_SQ}"'$//')";
     ;;
   *)
     lha_element="'$2";
@@ -3441,7 +3447,7 @@
     *)
       _MAN_LANG="${ms_lang}";
       # get first two characters of $ms_lang
-      _MAN_LANG2="$(echo1 "${ms_lang}" | sed -e 's/^\(..\).*$/\1/')";
+      _MAN_LANG2="$(echo1 "${ms_lang}" | sed 's/^\(..\).*$/\1/')";
       exit_test;
       ;;
   esac;
@@ -3494,7 +3500,10 @@
     do
       for j in "$i"/man*
       do
+        if obj j is_dir
+       then
         find "$j" >>"${_TMP_MAN}";
+        fi;
       done
     done;
   fi;
@@ -3655,7 +3664,7 @@
   if obj PATH is_not_empty
   then
     # delete the final `/bin' part
-    p="$(echo1 "${PATH}" | sed -e 's|//*bin/*:|:|g')";
+    p="$(echo1 "${PATH}" | sed 's|//*bin/*:|:|g')";
     obj_from_output msfp_list path_list "$p";
     # append some default directories
     for b in /usr/local /usr/local /usr /usr \
@@ -3844,7 +3853,7 @@
 
   # replace multiple colons by a single colon `:'
   # remove leading and trailing colons
-  echo1 "$1" | sed -e '
+  echo1 "$1" | sed '
 s/^:*//
 s/:::*/:/g
 s/:*$//
@@ -4049,13 +4058,13 @@
   # remove directory part
   obj_from_output rt_title base_name "$1";
   # replace space characters by `_'
-  rt_title="$(echo1 "${rt_title}" | sed -e 's/[        ]/_/g')";
+  rt_title="$(echo1 "${rt_title}" | sed 's/[   ]/_/g')";
   # remove extension `.bz2'
-  rt_title="$(echo1 "${rt_title}" | sed -e 's/\.bz2$//')";
+  rt_title="$(echo1 "${rt_title}" | sed 's/\.bz2$//')";
   # remove extension `.gz'
-  rt_title="$(echo1 "${rt_title}" | sed -e 's/\.gz$//')";
+  rt_title="$(echo1 "${rt_title}" | sed 's/\.gz$//')";
   # remove extension `.Z'
-  rt_title="$(echo1 "${rt_title}" | sed -e 's/\.Z$//')";
+  rt_title="$(echo1 "${rt_title}" | sed 's/\.Z$//')";
 
   if obj rt_title is_empty
   then
@@ -4365,11 +4374,11 @@
         tt_tmp="${_TMP_DIR}/,tmp";
         cat_z "${tt_1}" >"${tt_file}";
         grep '^\.[     ]*so[   ]' "${tt_file}" |
-         sed -e 's/^\.[        ]*so[   ]*//' >"${tt_tmp}";
+         sed 's/^\.[   ]*so[   ]*//' >"${tt_tmp}";
         list_from_file tt_list "${tt_tmp}";
         eval set x ${tt_list};
         shift;
-        for i in "$@"
+        for i
         do
           tt_i="$i";
           tt_so_nr="$(expr ${tt_so_nr} + 1)";
@@ -4392,7 +4401,7 @@
       obj_from_output tt_grog grog "${tt_file}";
       case " ${tt_grog} " in
       *\ -m*)
-        eval set x "$(echo1 " ${tt_grog} " | sed -e '
+        eval set x "$(echo1 " ${tt_grog} " | sed '
 s/'"${_TAB}"'/ /g
 s/  */ /g
 s/ -m / -m/g
@@ -4478,7 +4487,7 @@
 _do_man_so() {
   func_check _do_man_so '=' 1 "$@";
   _dms_so="$1";                        # evt. with `\ '
-  _dms_soname="$(echo $1 | sed -e 's/\\[       ]/ /g')"; # without `\ '
+  _dms_soname="$(echo $1 | sed 's/\\[  ]/ /g')"; # without `\ '
   case "${_dms_soname}" in
   /*)                          # absolute path
     if test -f "${_dms_soname}"
@@ -4547,8 +4556,8 @@
     echo2 "file from .so: ${_dms_so}";
   fi;
   cat_z "${_dms_sofound}" >"${tt_sofile}";
-  _dms_esc="$(echo ${_dms_so} | sed -e 's/\\/\\\\/g')";
-  cat "${tt_file}" | eval sed -e \
+  _dms_esc="$(echo ${_dms_so} | sed 's/\\/\\\\/g')";
+  cat "${tt_file}" | eval sed \
 "'s#^\\.[      ]*so[   ]*\(${_dms_so}\|${_dms_esc}\|${_dms_soname}\)[  ]*\$'"\
 "'#.so ${tt_sofile}#'" \
     >"${tt_tmp}";
@@ -4721,7 +4730,7 @@
 version()
 {
   func_check version = 0 "$@";
-  y="$(echo "${_LAST_UPDATE}" | sed -e 's/^.* //')";
+  y="$(echo "${_LAST_UPDATE}" | sed 's/^.* //')";
   cat <<EOF
 groffer ${_PROGRAM_VERSION} of ${_LAST_UPDATE} (shell version)
 is part of groff version ${_GROFF_VERSION}.
@@ -4790,7 +4799,7 @@
 
   # get the parts of the file name
   wf_name="$(base_name $1)";
-  wf_section="$(echo1 $1 | sed -n -e '
+  wf_section="$(echo1 $1 | sed -n '
 s|^.*/man\('"${_MAN_AUTO_SEC_CHARS}"'\).*$|\1|p
 ')";
   if obj wf_section is_not_empty
@@ -4807,14 +4816,14 @@
     esac
     if obj s is_yes
     then
-      wf_name="$(echo1 ${wf_name} | sed -e '
+      wf_name="$(echo1 ${wf_name} | sed '
 s/^\(.*\)\.'${wf_section}'.*$/\1/
 ')";
     fi;
   fi;
 
   # traditional man style; grep the line containing `.TH' macro, if any
-  wf_res="$(cat_z "$1" | sed -e '
+  wf_res="$(cat_z "$1" | sed '
 /'"${wf_dot}"'TH /p
 d
 ')";
@@ -4825,7 +4834,7 @@
     # - delete up to first .SH;
     # - print all lines before the next .SH;
     # - quit.
-    wf_res="$(cat_z "$1" | sed -n -e '
+    wf_res="$(cat_z "$1" | sed -n '
 1,/'"${wf_dot}"'SH/d
 /'"${wf_dot}"'SH/q
 p
@@ -4844,7 +4853,7 @@
       esac;
       if obj s is_yes
       then
-        wf_res="$(obj wf_res echo1 | sed -e '
+        wf_res="$(obj wf_res echo1 | sed '
 s/^'"${wf_name}${_SPACE_SED}"'[^-]*-'"${_SPACE_SED}"'*\(.*\)$/'"${wf_name}"' 
('"${wf_section}"') \\[em] \1/
 ')";
       fi;
@@ -4860,13 +4869,13 @@
   fi;
 
   # mdoc style (BSD doc); grep the line containing `.Nd' macro, if any
-  wf_res="$(cat_z "$1" | sed -n -e '/'"${wf_dot}"'Nd /s///p')";
+  wf_res="$(cat_z "$1" | sed -n '/'"${wf_dot}"'Nd /s///p')";
   exit_test;
   if obj wf_res is_not_empty
   then                         # BSD doc style
     if obj wf_section is_not_empty
     then
-      wf_res="$(obj wf_res echo1 | sed -n -e '
+      wf_res="$(obj wf_res echo1 | sed -n '
 s/^\(.*\)$/'"${wf_name}"' ('"${wf_section}"') \\[em] \1/p
 ')";
     fi;
@@ -4967,9 +4976,9 @@
   fi;
 
   # Remove disturbing multiple spaces and tabs
-  wip_1="$(echo1 "$1" | sed -e 's/[    ][      ]*/ /g' | \
-           sed -e 's/\(\\\)* / /g' | sed -e 's/^ //' | sed -e 's/ $//')";
-  wip_noarg="$(echo1 "${wip_1}" | sed -e 's/ -.*$//')";
+  wip_1="$(echo1 "$1" | sed 's/[       ][      ]*/ /g' | \
+           sed 's/\(\\\)* / /g' | sed 's/^ //' | sed 's/ $//')";
+  wip_noarg="$(echo1 "${wip_1}" | sed 's/ -.*$//')";
   exit_test;
 
   if obj wip_noarg is_empty
@@ -4982,7 +4991,7 @@
   case "${wip_1}" in
   *\ -*)
     wip_args="$(echo1 "${wip_1}" |
-                eval sed -e "'s#^${wip_noarg} ##'")";
+                eval sed "'s#^${wip_noarg} ##'")";
     exit_test;
     ;;
   *)
@@ -5016,7 +5025,7 @@
     obj_from_output wip_dir dir_name "${wip_noarg}";
     case "${wip_name}" in
     *\ *)
-      wip_base="$(echo1 "${wip_name}" | sed -e 's/ .*$//')";
+      wip_base="$(echo1 "${wip_name}" | sed 's/ .*$//')";
       exit_test;
       obj_from_output wip_file dir_name_append "${wip_dir}" "${wip_base}";
       exit_test;
@@ -5024,7 +5033,7 @@
       if test -f "${wip_file}" && test -x "${wip_file}"
       then
         wip_baseargs="$(echo1 "${wip_name}" |
-                        eval sed -e "'s#^${wip_base} ##'")";
+                        eval sed "'s#^${wip_base} ##'")";
         exit_test;
         if obj wip_args is_empty
         then
@@ -5096,7 +5105,7 @@
   case "${wip_noarg}" in
   *\ *)
     # test on path with base name without space
-    wip_base="$(echo1 "${wip_noarg}" | sed -e 's/^\([^ ]*\) .*$/\1/')";
+    wip_base="$(echo1 "${wip_noarg}" | sed 's/^\([^ ]*\) .*$/\1/')";
     exit_test;
     for d
     do
@@ -5109,7 +5118,7 @@
       if test -f "${wip_file}" && test -x "${wip_file}"
       then
         wip_baseargs="$(echo1 "${wip_noarg}" |
-                        sed -e 's/[^ ]* \(.*\)$/\1/')";
+                        sed 's/[^ ]* \(.*\)$/\1/')";
         exit_test;
         if obj wip_args is_empty
         then
@@ -5279,7 +5288,7 @@
   if obj MANOPT is_not_empty
   then
     # Delete leading and final spaces
-    MANOPT="$(echo1 "${MANOPT}" | sed -e '
+    MANOPT="$(echo1 "${MANOPT}" | sed '
 s/^'"${_SPACE_SED}"'*//
 s/'"${_SPACE_SED}"'*$//
 ')";
@@ -5467,7 +5476,7 @@
       ;;
     -?)
       # delete leading `-'
-      mpa_optchar="$(echo1 "${mpa_opt}" | sed -e 's/^-//')";
+      mpa_optchar="$(echo1 "${mpa_opt}" | sed 's/^-//')";
       exit_test;
       if list_has _OPTS_GROFF_SHORT_NA "${mpa_optchar}"
       then
@@ -6461,7 +6470,7 @@
     case "${mdfa_filespec}" in
     man:*)
         mdfa_names="${mdfa_names} "\
-"$(obj mdfa_filespec echo1 | sed -e 's/^man://')";
+"$(obj mdfa_filespec echo1 | sed 's/^man://')";
         ;;
     esac;
 
@@ -6478,9 +6487,9 @@
       fi;
       case "${mdfa_i}" in
       *\(${_MAN_AUTO_SEC_CHARS}*\))
-        mdfa_section="$(obj mdfa_i echo1 | sed -e 's/^[^(]*(\(.\).*)$/\1/')";
-        mdfa_name="$(obj mdfa_i echo1 | sed -e 's/^\([^(]*\)(.*)$/\1/')";
-        mdfa_ext="$(obj mdfa_i echo1 | sed -e 's/^[^(]*(.\(.*\))$/\1/')";
+        mdfa_section="$(obj mdfa_i echo1 | sed 's/^[^(]*(\(.\).*)$/\1/')";
+        mdfa_name="$(obj mdfa_i echo1 | sed 's/^\([^(]*\)(.*)$/\1/')";
+        mdfa_ext="$(obj mdfa_i echo1 | sed 's/^[^(]*(.\(.*\))$/\1/')";
         if man_is_man "${mdfa_name}" "${mdfa_section}" "${mdfa_ext}"
         then
           special_filespec;
@@ -6491,11 +6500,11 @@
         ;;
       *.${_MAN_AUTO_SEC_CHARS}*)
         mdfa_name="$(obj mdfa_i echo1 | \
-          sed -e 's/^\(.*\)\.'"${_MAN_AUTO_SEC_CHARS}"'.*$/\1/')";
+          sed 's/^\(.*\)\.'"${_MAN_AUTO_SEC_CHARS}"'.*$/\1/')";
         mdfa_section="$(obj mdfa_i echo1 | \
-          sed -e 's/^.*\.\('"${_MAN_AUTO_SEC_CHARS}"'\).*$/\1/')";
+          sed 's/^.*\.\('"${_MAN_AUTO_SEC_CHARS}"'\).*$/\1/')";
         mdfa_ext="$(obj mdfa_i echo1 | \
-          sed -e 's/^.*\.'"${_MAN_AUTO_SEC_CHARS}"'\(.*\)$/\1/')";
+          sed 's/^.*\.'"${_MAN_AUTO_SEC_CHARS}"'\(.*\)$/\1/')";
         if man_is_man "${mdfa_name}" "${mdfa_section}" "${mdfa_ext}"
         then
           special_filespec;
@@ -6524,9 +6533,9 @@
         ;;
       ${_MAN_AUTO_SEC_CHARS}*)
         mdfa_section="$(echo1 "${mdfa_filespec}" | \
-                        sed -e 's/^\(.\).*$/\1/')";
+                        sed 's/^\(.\).*$/\1/')";
         mdfa_ext="$(echo1 "${mdfa_filespec}" | \
-                    sed -e 's/^.\(.*\)$/\1/')";
+                    sed 's/^.\(.*\)$/\1/')";
         ;;
       *)
         echo2 "${mdfa_filespec} ${mdfa_errmsg}";
@@ -6591,7 +6600,7 @@
       continue;
       ;;
     ,*)
-      msr_n="$(echo1 "$1" | sed -e 's/^,,*//')";
+      msr_n="$(echo1 "$1" | sed 's/^,,*//')";
       exit_test;
       ;;
     esac;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]