env.c (98968) | env.c (102944) |
---|---|
1/* 2 * Copyright (c) 1988, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 30 unchanged lines hidden (view full) --- 39 40#if 0 41#ifndef lint 42static char sccsid[] = "@(#)env.c 8.3 (Berkeley) 4/2/94"; 43#endif /* not lint */ 44#endif 45 46#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1988, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 30 unchanged lines hidden (view full) --- 39 40#if 0 41#ifndef lint 42static char sccsid[] = "@(#)env.c 8.3 (Berkeley) 4/2/94"; 43#endif /* not lint */ 44#endif 45 46#include <sys/cdefs.h> |
47__FBSDID("$FreeBSD: head/usr.bin/env/env.c 98968 2002-06-28 09:23:39Z tjr $"); | 47__FBSDID("$FreeBSD: head/usr.bin/env/env.c 102944 2002-09-04 23:29:10Z dwmalone $"); |
48 49#include <err.h> 50#include <errno.h> 51#include <stdio.h> 52#include <string.h> 53#include <stdlib.h> 54#include <unistd.h> 55 56extern char **environ; 57 58static void usage(void); 59 60int | 48 49#include <err.h> 50#include <errno.h> 51#include <stdio.h> 52#include <string.h> 53#include <stdlib.h> 54#include <unistd.h> 55 56extern char **environ; 57 58static void usage(void); 59 60int |
61main(argc, argv) 62 int argc; 63 char **argv; | 61main(int argc, char **argv) |
64{ 65 char **ep, *p; 66 char *cleanenv[1]; 67 int ch; 68 69 while ((ch = getopt(argc, argv, "-i")) != -1) 70 switch(ch) { 71 case '-': --- 12 unchanged lines hidden (view full) --- 84 err(errno == ENOENT ? 127 : 126, "%s", *argv); 85 } 86 for (ep = environ; *ep; ep++) 87 (void)printf("%s\n", *ep); 88 exit(0); 89} 90 91static void | 62{ 63 char **ep, *p; 64 char *cleanenv[1]; 65 int ch; 66 67 while ((ch = getopt(argc, argv, "-i")) != -1) 68 switch(ch) { 69 case '-': --- 12 unchanged lines hidden (view full) --- 82 err(errno == ENOENT ? 127 : 126, "%s", *argv); 83 } 84 for (ep = environ; *ep; ep++) 85 (void)printf("%s\n", *ep); 86 exit(0); 87} 88 89static void |
92usage() | 90usage(void) |
93{ 94 (void)fprintf(stderr, 95 "usage: env [-i] [name=value ...] [utility [argument ...]]\n"); 96 exit(1); 97} | 91{ 92 (void)fprintf(stderr, 93 "usage: env [-i] [name=value ...] [utility [argument ...]]\n"); 94 exit(1); 95} |