text: /*************************************************************************\
  *                  Copyright (C) Michael Kerrisk, 2014.                   *
  *                                                                         *
  * This program is free software. You may use, modify, and redistribute it *
  * under the terms of the GNU Affero General Public License as published   *
  * by the Free Software Foundation, either version 3 or (at your option)   *
  * any later version. This program is distributed without any warranty.    *
  * See the file COPYING.agpl-v3 for details.                               *
  \*************************************************************************/
  
  /* Listing 27-4 */
  
  #include "tlpi_hdr.h"
  
  int
  main(int argc, char *argv[])
  {
      char *envVec[] = { "GREET=salut", "BYE=adieu", NULL };
      char *filename;
  
      if (argc != 2 || strcmp(argv[1], "--help") == 0)
          usageErr("%s pathname\n", argv[0]);
  
      filename = strrchr(argv[1], '/');       /* Get basename from argv[1] */
      if (filename != NULL)
          filename++;
      else
          filename = argv[1];
  
      execle(argv[1], filename, "hello world", (char *) NULL, envVec);
      errExit("execle");          /* If we get here, something went wrong */
  }
  