Home » Source Code » » yes.c

yes.c ( File view )

From:
  • By 2010-08-22
  • View(s):18
  • Download(s):0
  • Point(s): 1
			/* vi: set sw=4 ts=4: */
/*
 * Mini yes implementation for busybox
 *
 * Copyright (C) 2000  Edward Betts <edward@debian.org>.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */

/* getopt not needed */

#include <stdio.h>
#include <stdlib.h>
#include "busybox.h"

extern int yes_main(int argc, char **argv)
{

	int i;

	if (argc >= 2 && *argv[1] == '-')
		show_usage();

	if (argc == 1) {

		while (1)
			if (puts("y") == EOF) {

				perror("yes");
				return EXIT_FAILURE;
			
}
	
}

	while (1)
		for (i = 1; i < argc; i++)
			if (fputs(argv[i], stdout) == EOF
				|| putchar(i == argc - 1 ? '\n' : ' ') == EOF) {

				perror("yes");
				return EXIT_FAILURE;
			
}

	return EXIT_SUCCESS;

}
			
...
Expand> <Close

Want complete source code? Download it here

Point(s): 1

Download
0 lines left, continue to read
Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
源码文件 busybox.linksbusybox.links914.00 B27-10-02 13:04
源码文件 .cvsignore.cvsignore50.00 B07-07-01 03:19
源码文件 .indent.pro.indent.pro871.00 B25-07-00 06:36
源码文件 AUTHORSAUTHORS2.56 kB27-04-02 16:43
源码文件 ChangelogChangelog66.78 kB27-10-02 12:50
源码文件 Changelog.fullChangelog.full3.77 kB27-10-02 12:50
code file Config.hConfig.h14.06 kB18-09-02 06:04
源码文件 INSTALLINSTALL144.00 B10-05-01 22:12
源码文件 LICENSELICENSE18.57 kB20-11-01 07:57
code file MakefileMakefile16.52 kB27-10-02 12:47
code file READMEREADME5.71 kB22-12-01 08:42
code file TODOTODO1.71 kB27-04-02 15:30
code file adjtimex.cadjtimex.c4.79 kB05-04-01 11:14
code file applets.capplets.c3.08 kB28-08-01 01:19
code file applets.happlets.h11.31 kB18-09-02 06:04
code file ar.car.c2.37 kB27-10-01 07:08
code file ash.cash.c259.35 kB23-10-02 06:14
code file basename.cbasename.c1.33 kB20-11-01 07:34
code file busybox.cbusybox.c3.71 kB06-04-02 13:01
code file busybox.hbusybox.h3.20 kB16-03-02 10:11
源码文件 busybox.mkllbusybox.mkll560.00 B09-03-01 05:42
code file busybox.shbusybox.sh390.00 B26-09-01 14:20
源码文件 busybox.specbusybox.spec1.19 kB27-04-02 16:43
code file cat.ccat.c1.35 kB20-11-01 07:34
code file chgrp.cchgrp.c2.22 kB20-11-01 07:34
code file chmod.cchmod.c2.33 kB28-02-02 12:37
code file chown.cchown.c2.74 kB20-11-01 07:34
code file chroot.cchroot.c1.76 kB20-11-01 07:34
code file chvt.cchvt.c833.00 B16-09-02 13:59
code file clear.cclear.c1.06 kB20-11-01 07:34
code file cmdedit.ccmdedit.c34.24 kB25-04-02 07:07
code file cmdedit.hcmdedit.h121.00 B17-07-01 09:12
code file cmp.ccmp.c1.90 kB20-11-01 07:34
code file cp.ccp.c3.00 kB28-02-02 12:38
code file cpio.ccpio.c2.74 kB27-10-01 07:08
code file cut.ccut.c9.02 kB20-11-01 07:34
code file date.cdate.c5.87 kB15-06-02 22:35
code file dc.cdc.c2.93 kB09-03-01 22:36
code file dd.cdd.c4.09 kB27-04-02 09:28
code file deallocvt.cdeallocvt.c967.00 B16-09-02 13:59
code file df.cdf.c4.05 kB20-11-01 07:34
code file dirname.cdirname.c1.17 kB20-11-01 07:34
code file dmesg.cdmesg.c1.96 kB05-04-01 11:14
code file dos2unix.cdos2unix.c4.91 kB07-06-02 01:37
code file dpkg.cdpkg.c43.95 kB16-09-02 14:27
code file dpkg_deb.cdpkg_deb.c3.61 kB18-07-01 23:47
code file du.cdu.c4.03 kB19-09-02 03:21
code file dumpkmap.cdumpkmap.c2.27 kB23-07-01 22:52
code file dutmp.cdutmp.c1.52 kB03-07-02 13:32
code file echo.cecho.c4.18 kB10-04-01 06:48
code file env.cenv.c3.55 kB20-11-01 07:57
code file expr.cexpr.c10.06 kB16-05-01 22:21
code file fbset.cfbset.c12.78 kB17-09-02 16:44
code file fdflush.cfdflush.c1.26 kB20-02-01 14:14
code file find.cfind.c5.49 kB28-02-02 13:24
code file free.cfree.c2.11 kB17-09-02 15:44
code file freeramdisk.cfreeramdisk.c1.63 kB27-10-01 07:08
code file fsck_minix.cfsck_minix.c35.64 kB30-08-01 03:02
code file getopt.cgetopt.c13.82 kB24-04-01 07:16
code file grep.cgrep.c9.60 kB06-12-01 15:12
code file gunzip.cgunzip.c5.70 kB20-09-02 16:21
code file gzip.cgzip.c79.44 kB28-02-02 11:54
code file halt.chalt.c1.28 kB13-04-02 16:33
code file head.chead.c2.32 kB17-09-02 15:44
code file hostid.chostid.c1.01 kB20-02-01 14:14
code file hostname.chostname.c2.92 kB19-10-02 06:07
code file hush.chush.c80.29 kB27-04-02 12:12
code file id.cid.c2.12 kB16-05-01 22:21
code file ifconfig.cifconfig.c13.46 kB23-10-02 06:14
code file init.cinit.c28.88 kB23-10-02 03:15
code file insmod.cinsmod.c88.17 kB16-09-02 13:30
code file install.shinstall.sh911.00 B09-03-01 05:42
code file kill.ckill.c3.45 kB16-09-02 14:19
code file klogd.cklogd.c3.98 kB18-09-02 22:22
code file lash.clash.c40.44 kB01-10-02 04:17
code file length.clength.c274.00 B20-02-01 14:14
code file ln.cln.c2.96 kB20-11-01 07:34
code file loadacm.cloadacm.c8.15 kB23-07-01 22:52
code file loadfont.cloadfont.c4.85 kB23-07-01 22:52
code file loadkmap.cloadkmap.c2.42 kB23-07-01 22:52
code file logger.clogger.c5.58 kB20-11-01 07:34
code file logname.clogname.c1.13 kB20-02-01 14:14
code file logread.clogread.c3.48 kB10-04-01 07:52
code file losetup.closetup.c1.45 kB10-04-02 03:59
code file ls.cls.c25.75 kB16-09-02 13:53
code file lsmod.clsmod.c5.00 kB19-10-02 06:12
code file makedevs.cmakedevs.c1.76 kB08-06-02 20:40
code file md5sum.cmd5sum.c30.44 kB23-10-02 06:13
code file mk_loop_h.shmk_loop_h.sh1.16 kB17-09-02 15:44
code file mkdir.cmkdir.c1.56 kB22-06-01 03:41
code file mkfifo.cmkfifo.c1.43 kB20-02-01 14:14
code file mkfs_minix.cmkfs_minix.c20.85 kB30-08-01 03:02
code file mknod.cmknod.c1.91 kB13-04-02 13:56
code file mkswap.cmkswap.c10.56 kB06-04-02 13:01
code file mktemp.cmktemp.c1.21 kB09-03-01 22:36
code file modprobe.cmodprobe.c7.22 kB18-09-02 23:07
code file more.cmore.c5.58 kB06-12-01 15:22
code file mount.cmount.c13.44 kB16-09-02 15:56
code file msh.cmsh.c84.71 kB17-09-02 16:04
code file mt.cmt.c2.18 kB22-05-01 22:32
code file mv.cmv.c3.73 kB27-10-01 07:08
code file nc.cnc.c4.04 kB05-05-02 11:39
code file nfsmount.cnfsmount.c24.66 kB26-07-01 22:26
code file nfsmount.hnfsmount.h7.32 kB10-03-01 06:18
code file nslookup.cnslookup.c4.09 kB27-04-02 12:04
code file pidof.cpidof.c1.92 kB13-04-02 21:32
code file ping.cping.c14.64 kB17-09-02 15:56
code file pivot_root.cpivot_root.c669.00 B05-04-01 11:14
code file poweroff.cpoweroff.c1.29 kB13-04-02 13:56
code file printf.cprintf.c9.92 kB20-03-01 03:25
code file pristine_setup.shpristine_setup.sh1.11 kB20-12-01 23:58
code file ps.cps.c8.99 kB17-09-02 16:23
code file pwd.cpwd.c1.14 kB13-04-02 13:56
code file rdate.crdate.c2.92 kB27-10-01 07:08
code file readlink.creadlink.c1.20 kB20-11-01 07:34
code file reboot.creboot.c2.77 kB17-09-02 16:23
code file renice.crenice.c1.45 kB20-02-01 14:14
code file reset.creset.c1.13 kB18-09-02 05:21
code file rm.crm.c1.79 kB30-06-01 02:59
code file rmdir.crmdir.c2.06 kB20-11-01 07:34
code file rmmod.crmmod.c1.61 kB20-11-01 07:34
code file route.croute.c10.52 kB17-09-02 15:56
code file rpm2cpio.crpm2cpio.c2.92 kB30-08-01 03:02
code file sed.csed.c23.59 kB17-09-02 15:56
code file setkeycodes.csetkeycodes.c1.87 kB16-09-02 13:59
code file sleep.csleep.c1.11 kB13-04-02 13:56
code file sort.csort.c2.54 kB18-04-01 02:56
code file stty.cstty.c37.71 kB06-06-02 19:34
code file swaponoff.cswaponoff.c2.56 kB26-10-02 18:27
code file sync.csync.c1.05 kB20-02-01 14:14
code file syslogd.csyslogd.c16.58 kB18-09-02 04:04
code file tail.ctail.c5.88 kB17-09-02 15:44
code file tar.ctar.c32.94 kB17-09-02 15:56
code file tee.ctee.c1.58 kB20-11-01 07:34
code file telnet.ctelnet.c13.75 kB27-08-02 05:36
code file test.ctest.c10.40 kB27-10-01 07:08
code file tftp.ctftp.c12.52 kB25-10-02 20:05
code file time.ctime.c15.35 kB01-10-02 03:37
code file top.ctop.c17.63 kB23-10-02 18:21
code file touch.ctouch.c1.78 kB20-11-01 07:34
code file tr.ctr.c6.65 kB10-07-01 05:32
code file traceroute.ctraceroute.c17.46 kB06-06-02 22:23
code file true_false.ctrue_false.c1.12 kB20-11-01 07:34
code file tty.ctty.c1.20 kB20-02-01 14:14
code file umount.cumount.c6.94 kB20-11-01 07:34
code file uname.cuname.c3.90 kB09-03-01 22:36
code file uniq.cuniq.c2.23 kB20-11-01 07:34
code file update.cupdate.c2.68 kB02-08-01 13:02
code file uptime.cuptime.c2.44 kB20-11-01 07:34
code file usage.cusage.c116.00 B22-02-01 09:15
code file usage.husage.h65.81 kB01-10-02 04:59
code file usleep.cusleep.c1.10 kB20-03-01 07:49
code file uudecode.cuudecode.c10.94 kB17-09-02 15:56
code file uuencode.cuuencode.c4.96 kB29-07-01 14:04
code file vi.cvi.c111.55 kB26-10-02 18:19
code file watchdog.cwatchdog.c1.20 kB10-03-01 05:28
code file wc.cwc.c3.60 kB12-12-01 00:00
code file wget.cwget.c20.52 kB27-04-02 15:40
code file which.cwhich.c1.94 kB20-11-01 07:34
code file whoami.cwhoami.c1.20 kB10-03-01 05:28
code file xargs.cxargs.c3.16 kB16-09-02 18:52
code file yes.cyes.c1.32 kB10-03-01 05:28
源码文件 Config.h-debConfig.h-deb14.03 kB18-09-02 06:04
源码文件 Config.h-staticConfig.h-static13.86 kB18-09-02 06:04
源码文件 Config.h-udebConfig.h-udeb14.04 kB26-10-02 20:23
code file README.debianREADME.debian318.00 B27-04-02 16:43
源码文件 changelogchangelog11.54 kB27-10-02 12:47
源码文件 controlcontrol2.96 kB27-10-02 12:47
源码文件 copyrightcopyright216.00 B19-06-00 17:21
源码文件 rulesrules5.41 kB27-04-02 17:07
源码文件 <debian><debian>0.00 B22-08-06 10:49
源码文件 busybox.podbusybox.pod57.61 kB27-10-02 13:04
源码文件 .cvsignore.cvsignore90.00 B09-10-02 03:29
code file autodocifier.plautodocifier.pl5.59 kB20-11-01 07:57
源码文件 busybox.sgmlbusybox.sgml67.90 kB20-11-01 07:57
源码文件 busybox_footer.podbusybox_footer.pod3.34 kB20-11-01 07:57
源码文件 busybox_header.podbusybox_header.pod2.66 kB28-08-01 02:55
code file contributing.txtcontributing.txt17.51 kB20-11-01 07:57
code file new-applet-HOWTO.txtnew-applet-HOWTO.txt3.71 kB20-11-01 07:57
code file style-guide.txtstyle-guide.txt18.45 kB15-03-01 05:04
code file BusyBox.txtBusyBox.txt75.45 kB27-10-02 13:04
源码文件 BusyBox.1BusyBox.183.34 kB27-10-02 13:04
code file BusyBox.htmlBusyBox.html83.71 kB27-10-02 13:04
源码文件 <docs><docs>0.00 B22-08-06 10:49
源码文件 Will_devps_GoIntoTheKernelWill_devps_GoIntoTheKernel4.41 kB06-11-01 07:09
源码文件 devps.patch.9_25_2000devps.patch.9_25_200041.39 kB26-09-00 08:20
源码文件 <kernel-patches><kernel-patches>0.00 B22-08-06 10:49
源码文件 .cvsignore.cvsignore7.00 B17-03-01 08:15
code file MakefileMakefile254.00 B17-09-02 15:44
code file READMEREADME473.00 B20-11-01 07:57
code file arith.carith.c12.17 kB17-09-02 15:56
code file ask_confirmation.cask_confirmation.c1.15 kB06-12-01 16:10
code file chomp.cchomp.c1.08 kB06-12-01 16:10
code file concat_path_file.cconcat_path_file.c1.33 kB06-12-01 16:19
code file copy_file.ccopy_file.c6.60 kB08-10-02 12:37
code file copy_file_chunk.ccopy_file_chunk.c1.75 kB06-12-01 16:10
code file copyfd.ccopyfd.c1.33 kB18-05-01 22:14
code file create_icmp_socket.ccreate_icmp_socket.c819.00 B13-07-01 04:26
code file device_open.cdevice_open.c1.32 kB06-12-01 16:10
code file dirname.cdirname.c1.33 kB06-04-02 13:14
code file error_msg.cerror_msg.c1.14 kB06-12-01 16:19
code file error_msg_and_die.cerror_msg_and_die.c1.17 kB06-12-01 16:10
code file fgets_str.cfgets_str.c1.74 kB06-12-01 15:51
code file find_mount_point.cfind_mount_point.c1.97 kB06-12-01 16:10
code file find_pid_by_name.cfind_pid_by_name.c4.41 kB06-12-01 23:05
code file find_root_device.cfind_root_device.c2.14 kB06-12-01 16:10
code file full_read.cfull_read.c1.40 kB06-12-01 16:10
code file full_write.cfull_write.c1.34 kB06-12-01 16:10
code file get_console.cget_console.c2.52 kB16-09-02 13:59
code file get_last_path_component.cget_last_path_component.c1.43 kB06-12-01 16:23
code file get_line_from_file.cget_line_from_file.c1.66 kB06-12-01 15:50
code file gz_open.cgz_open.c1.61 kB17-09-02 15:44
code file herror_msg.cherror_msg.c1.08 kB06-12-01 16:10
code file herror_msg_and_die.cherror_msg_and_die.c1.11 kB06-12-01 16:10
code file human_readable.chuman_readable.c2.57 kB01-07-01 02:08
code file inode_hash.cinode_hash.c2.74 kB19-09-02 03:21
code file interface.cinterface.c48.50 kB17-09-02 14:36
code file isdirectory.cisdirectory.c1.65 kB06-12-01 16:10
code file kernel_version.ckernel_version.c1.53 kB06-12-01 16:10
code file last_char_is.clast_char_is.c1.23 kB07-07-01 12:27
code file libbb.hlibbb.h11.18 kB19-09-02 03:21
code file libc5.clibc5.c5.17 kB17-09-02 15:44
code file loop.cloop.c2.76 kB28-02-02 11:57
code file make_directory.cmake_directory.c1.84 kB25-08-01 03:51
code file messages.cmessages.c2.14 kB20-11-01 07:34
code file mode_string.cmode_string.c1.94 kB06-12-01 16:10
code file module_syscalls.cmodule_syscalls.c2.77 kB12-03-02 08:33
code file mtab.cmtab.c3.05 kB06-12-01 16:10
code file mtab_file.cmtab_file.c1.30 kB06-12-01 16:10
code file my_getgrgid.cmy_getgrgid.c1.26 kB06-12-01 16:10
code file my_getgrnam.cmy_getgrnam.c1.26 kB06-12-01 16:10
code file my_getpwnam.cmy_getpwnam.c1.25 kB06-12-01 16:10
code file my_getpwnamegid.cmy_getpwnamegid.c1.39 kB06-12-01 16:10
code file my_getpwuid.cmy_getpwuid.c1.25 kB06-12-01 16:10
code file parse_mode.cparse_mode.c3.02 kB06-12-01 16:10
code file parse_number.cparse_number.c1.62 kB06-12-01 16:10
code file perror_msg.cperror_msg.c1.12 kB06-12-01 16:10
code file perror_msg_and_die.cperror_msg_and_die.c1.15 kB06-12-01 16:10
code file print_file.cprint_file.c1.40 kB16-05-01 01:48
code file process_escape_sequence.cprocess_escape_sequence.c1.83 kB10-04-01 06:48
code file read_package_field.cread_package_field.c3.04 kB06-12-01 16:10
code file real_loop.hreal_loop.h900.00 B19-04-01 06:23
code file recursive_action.crecursive_action.c3.56 kB06-12-01 16:10
code file remove_file.cremove_file.c2.92 kB06-12-01 16:10
code file safe_read.csafe_read.c1.14 kB06-12-01 16:10
code file safe_strncpy.csafe_strncpy.c1.17 kB06-12-01 16:10
code file simplify_path.csimplify_path.c1.62 kB06-12-01 16:10
code file syscalls.csyscalls.c3.37 kB12-03-02 08:33
code file syslog_msg_with_name.csyslog_msg_with_name.c1.25 kB06-12-01 16:10
code file time_string.ctime_string.c1.42 kB06-12-01 16:10
code file trim.ctrim.c1.22 kB06-12-01 16:10
code file u_signal_names.cu_signal_names.c5.63 kB06-12-01 16:10
code file unarchive.cunarchive.c18.86 kB06-04-02 12:33
code file unzip.cunzip.c30.10 kB16-09-02 15:08
code file vdprintf.cvdprintf.c1.17 kB07-06-02 01:37
code file verror_msg.cverror_msg.c1.14 kB06-12-01 16:10
code file vherror_msg.cvherror_msg.c1.06 kB06-12-01 16:10
code file vperror_msg.cvperror_msg.c1.18 kB06-12-01 16:10
code file wfopen.cwfopen.c1.13 kB06-12-01 16:10
code file xfuncs.cxfuncs.c2.13 kB13-04-02 22:44
code file xgetcwd.cxgetcwd.c1.17 kB22-08-01 13:35
code file xgethostbyname.cxgethostbyname.c1.07 kB06-12-01 16:10
code file xreadlink.cxreadlink.c756.00 B08-05-01 01:48
code file xregcomp.cxregcomp.c1.29 kB06-12-01 16:10
源码文件 <libbb><libbb>0.00 B22-08-06 10:49
源码文件 .indent.pro.indent.pro871.00 B27-01-01 14:01
code file __getgrent.c__getgrent.c4.31 kB13-04-02 23:29
code file __getpwent.c__getpwent.c3.08 kB27-01-01 16:24
code file config.hconfig.h2.28 kB27-01-01 14:01
code file fgetgrent.cfgetgrent.c1.05 kB27-01-01 16:24
code file fgetpwent.cfgetpwent.c1.05 kB27-01-01 16:24
code file getgrgid.cgetgrgid.c1.22 kB27-01-01 16:24
code file getgrnam.cgetgrnam.c1.31 kB27-01-01 16:24
code file getpw.cgetpw.c1.32 kB27-01-01 16:24
code file getpwnam.cgetpwnam.c1.33 kB27-01-01 16:24
code file getpwuid.cgetpwuid.c1.24 kB27-01-01 16:24
code file grent.cgrent.c1.37 kB27-01-01 16:24
code file grp.hgrp.h873.00 B27-01-01 16:24
code file initgroups.cinitgroups.c1.95 kB16-09-02 14:28
code file putpwent.cputpwent.c1.23 kB10-09-02 13:22
code file pwd.hpwd.h993.00 B27-01-01 16:24
code file pwent.cpwent.c1.48 kB27-01-01 16:24
code file setgroups.csetgroups.c1.34 kB12-03-02 08:33
源码文件 <pwd_grp><pwd_grp>0.00 B22-08-06 10:49
源码文件 depmod.pldepmod.pl5.32 kB20-11-01 07:57
源码文件 inittabinittab3.33 kB18-12-01 07:15
源码文件 mk2knr.plmk2knr.pl2.41 kB18-04-01 01:37
源码文件 undebundeb1.26 kB13-12-00 00:49
源码文件 unrpmunrpm1.06 kB26-06-01 09:19
源码文件 <scripts><scripts>0.00 B22-08-06 10:49
源码文件 .cvsignore.cvsignore110.00 B20-04-00 02:52
code file MakefileMakefile675.00 B22-08-00 07:01
源码文件 cp_tests.mkcp_tests.mk8.73 kB12-12-00 01:33
源码文件 ln_tests.mkln_tests.mk1.39 kB05-03-00 05:19
源码文件 multibuild.plmultibuild.pl2.15 kB16-03-01 06:14
源码文件 multifeat.plmultifeat.pl2.36 kB16-03-01 06:14
源码文件 mv_tests.mkmv_tests.mk3.81 kB12-12-00 01:33
源码文件 sh.testcasessh.testcases1.90 kB19-10-02 06:18
code file syslog_test.csyslog_test.c298.00 B20-04-00 02:52
源码文件 testcasestestcases6.78 kB28-08-01 02:55
code file tester.shtester.sh3.95 kB25-05-01 05:24
code file tst-syslogd.ctst-syslogd.c837.00 B13-03-01 04:00
源码文件 <tests><tests>0.00 B22-08-06 10:49
源码文件 <busybox><busybox>0.00 B22-08-06 10:49
...
Sponsored links
×

yes.c (908.44 kB)

Need 1 point
Your Point(s)

Your Point isn't enough.

Get point immediately by PayPal

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more point

×

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com
×

切换到中文版?

CodeForge Chinese Version
CodeForge English Version
×

Where are you going?

×

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK
×

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D