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.links914.00 B27-10-02 13:04
.cvsignore50.00 B07-07-01 03:19
.indent.pro871.00 B25-07-00 06:36
AUTHORS2.56 kB27-04-02 16:43
Changelog66.78 kB27-10-02 12:50
Changelog.full3.77 kB27-10-02 12:50
Config.h14.06 kB18-09-02 06:04
INSTALL144.00 B10-05-01 22:12
LICENSE18.57 kB20-11-01 07:57
Makefile16.52 kB27-10-02 12:47
README5.71 kB22-12-01 08:42
TODO1.71 kB27-04-02 15:30
adjtimex.c4.79 kB05-04-01 11:14
applets.c3.08 kB28-08-01 01:19
applets.h11.31 kB18-09-02 06:04
ar.c2.37 kB27-10-01 07:08
ash.c259.35 kB23-10-02 06:14
basename.c1.33 kB20-11-01 07:34
busybox.c3.71 kB06-04-02 13:01
busybox.h3.20 kB16-03-02 10:11
busybox.mkll560.00 B09-03-01 05:42
busybox.sh390.00 B26-09-01 14:20
busybox.spec1.19 kB27-04-02 16:43
cat.c1.35 kB20-11-01 07:34
chgrp.c2.22 kB20-11-01 07:34
chmod.c2.33 kB28-02-02 12:37
chown.c2.74 kB20-11-01 07:34
chroot.c1.76 kB20-11-01 07:34
chvt.c833.00 B16-09-02 13:59
clear.c1.06 kB20-11-01 07:34
cmdedit.c34.24 kB25-04-02 07:07
cmdedit.h121.00 B17-07-01 09:12
cmp.c1.90 kB20-11-01 07:34
cp.c3.00 kB28-02-02 12:38
cpio.c2.74 kB27-10-01 07:08
cut.c9.02 kB20-11-01 07:34
date.c5.87 kB15-06-02 22:35
dc.c2.93 kB09-03-01 22:36
dd.c4.09 kB27-04-02 09:28
deallocvt.c967.00 B16-09-02 13:59
df.c4.05 kB20-11-01 07:34
dirname.c1.17 kB20-11-01 07:34
dmesg.c1.96 kB05-04-01 11:14
dos2unix.c4.91 kB07-06-02 01:37
dpkg.c43.95 kB16-09-02 14:27
dpkg_deb.c3.61 kB18-07-01 23:47
du.c4.03 kB19-09-02 03:21
dumpkmap.c2.27 kB23-07-01 22:52
dutmp.c1.52 kB03-07-02 13:32
echo.c4.18 kB10-04-01 06:48
env.c3.55 kB20-11-01 07:57
expr.c10.06 kB16-05-01 22:21
fbset.c12.78 kB17-09-02 16:44
fdflush.c1.26 kB20-02-01 14:14
find.c5.49 kB28-02-02 13:24
free.c2.11 kB17-09-02 15:44
freeramdisk.c1.63 kB27-10-01 07:08
fsck_minix.c35.64 kB30-08-01 03:02
getopt.c13.82 kB24-04-01 07:16
grep.c9.60 kB06-12-01 15:12
gunzip.c5.70 kB20-09-02 16:21
gzip.c79.44 kB28-02-02 11:54
halt.c1.28 kB13-04-02 16:33
head.c2.32 kB17-09-02 15:44
hostid.c1.01 kB20-02-01 14:14
hostname.c2.92 kB19-10-02 06:07
hush.c80.29 kB27-04-02 12:12
id.c2.12 kB16-05-01 22:21
ifconfig.c13.46 kB23-10-02 06:14
init.c28.88 kB23-10-02 03:15
insmod.c88.17 kB16-09-02 13:30
install.sh911.00 B09-03-01 05:42
kill.c3.45 kB16-09-02 14:19
klogd.c3.98 kB18-09-02 22:22
lash.c40.44 kB01-10-02 04:17
length.c274.00 B20-02-01 14:14
ln.c2.96 kB20-11-01 07:34
loadacm.c8.15 kB23-07-01 22:52
loadfont.c4.85 kB23-07-01 22:52
loadkmap.c2.42 kB23-07-01 22:52
logger.c5.58 kB20-11-01 07:34
logname.c1.13 kB20-02-01 14:14
logread.c3.48 kB10-04-01 07:52
losetup.c1.45 kB10-04-02 03:59
ls.c25.75 kB16-09-02 13:53
lsmod.c5.00 kB19-10-02 06:12
makedevs.c1.76 kB08-06-02 20:40
md5sum.c30.44 kB23-10-02 06:13
mk_loop_h.sh1.16 kB17-09-02 15:44
mkdir.c1.56 kB22-06-01 03:41
mkfifo.c1.43 kB20-02-01 14:14
mkfs_minix.c20.85 kB30-08-01 03:02
mknod.c1.91 kB13-04-02 13:56
mkswap.c10.56 kB06-04-02 13:01
mktemp.c1.21 kB09-03-01 22:36
modprobe.c7.22 kB18-09-02 23:07
more.c5.58 kB06-12-01 15:22
mount.c13.44 kB16-09-02 15:56
msh.c84.71 kB17-09-02 16:04
mt.c2.18 kB22-05-01 22:32
mv.c3.73 kB27-10-01 07:08
nc.c4.04 kB05-05-02 11:39
nfsmount.c24.66 kB26-07-01 22:26
nfsmount.h7.32 kB10-03-01 06:18
nslookup.c4.09 kB27-04-02 12:04
pidof.c1.92 kB13-04-02 21:32
ping.c14.64 kB17-09-02 15:56
pivot_root.c669.00 B05-04-01 11:14
poweroff.c1.29 kB13-04-02 13:56
printf.c9.92 kB20-03-01 03:25
pristine_setup.sh1.11 kB20-12-01 23:58
ps.c8.99 kB17-09-02 16:23
pwd.c1.14 kB13-04-02 13:56
rdate.c2.92 kB27-10-01 07:08
readlink.c1.20 kB20-11-01 07:34
reboot.c2.77 kB17-09-02 16:23
renice.c1.45 kB20-02-01 14:14
reset.c1.13 kB18-09-02 05:21
rm.c1.79 kB30-06-01 02:59
rmdir.c2.06 kB20-11-01 07:34
rmmod.c1.61 kB20-11-01 07:34
route.c10.52 kB17-09-02 15:56
rpm2cpio.c2.92 kB30-08-01 03:02
sed.c23.59 kB17-09-02 15:56
setkeycodes.c1.87 kB16-09-02 13:59
sleep.c1.11 kB13-04-02 13:56
sort.c2.54 kB18-04-01 02:56
stty.c37.71 kB06-06-02 19:34
swaponoff.c2.56 kB26-10-02 18:27
sync.c1.05 kB20-02-01 14:14
syslogd.c16.58 kB18-09-02 04:04
tail.c5.88 kB17-09-02 15:44
tar.c32.94 kB17-09-02 15:56
tee.c1.58 kB20-11-01 07:34
telnet.c13.75 kB27-08-02 05:36
test.c10.40 kB27-10-01 07:08
tftp.c12.52 kB25-10-02 20:05
time.c15.35 kB01-10-02 03:37
top.c17.63 kB23-10-02 18:21
touch.c1.78 kB20-11-01 07:34
tr.c6.65 kB10-07-01 05:32
traceroute.c17.46 kB06-06-02 22:23
true_false.c1.12 kB20-11-01 07:34
tty.c1.20 kB20-02-01 14:14
umount.c6.94 kB20-11-01 07:34
uname.c3.90 kB09-03-01 22:36
uniq.c2.23 kB20-11-01 07:34
update.c2.68 kB02-08-01 13:02
uptime.c2.44 kB20-11-01 07:34
usage.c116.00 B22-02-01 09:15
usage.h65.81 kB01-10-02 04:59
usleep.c1.10 kB20-03-01 07:49
uudecode.c10.94 kB17-09-02 15:56
uuencode.c4.96 kB29-07-01 14:04
vi.c111.55 kB26-10-02 18:19
watchdog.c1.20 kB10-03-01 05:28
wc.c3.60 kB12-12-01 00:00
wget.c20.52 kB27-04-02 15:40
which.c1.94 kB20-11-01 07:34
whoami.c1.20 kB10-03-01 05:28
xargs.c3.16 kB16-09-02 18:52
yes.c1.32 kB10-03-01 05:28
Config.h-deb14.03 kB18-09-02 06:04
Config.h-static13.86 kB18-09-02 06:04
Config.h-udeb14.04 kB26-10-02 20:23
README.debian318.00 B27-04-02 16:43
changelog11.54 kB27-10-02 12:47
control2.96 kB27-10-02 12:47
copyright216.00 B19-06-00 17:21
rules5.41 kB27-04-02 17:07
<debian>0.00 B22-08-06 10:49
busybox.pod57.61 kB27-10-02 13:04
.cvsignore90.00 B09-10-02 03:29
autodocifier.pl5.59 kB20-11-01 07:57
busybox.sgml67.90 kB20-11-01 07:57
busybox_footer.pod3.34 kB20-11-01 07:57
busybox_header.pod2.66 kB28-08-01 02:55
contributing.txt17.51 kB20-11-01 07:57
new-applet-HOWTO.txt3.71 kB20-11-01 07:57
style-guide.txt18.45 kB15-03-01 05:04
BusyBox.txt75.45 kB27-10-02 13:04
BusyBox.183.34 kB27-10-02 13:04
BusyBox.html83.71 kB27-10-02 13:04
<docs>0.00 B22-08-06 10:49
Will_devps_GoIntoTheKernel4.41 kB06-11-01 07:09
devps.patch.9_25_200041.39 kB26-09-00 08:20
<kernel-patches>0.00 B22-08-06 10:49
.cvsignore7.00 B17-03-01 08:15
Makefile254.00 B17-09-02 15:44
README473.00 B20-11-01 07:57
arith.c12.17 kB17-09-02 15:56
ask_confirmation.c1.15 kB06-12-01 16:10
chomp.c1.08 kB06-12-01 16:10
concat_path_file.c1.33 kB06-12-01 16:19
copy_file.c6.60 kB08-10-02 12:37
copy_file_chunk.c1.75 kB06-12-01 16:10
copyfd.c1.33 kB18-05-01 22:14
create_icmp_socket.c819.00 B13-07-01 04:26
device_open.c1.32 kB06-12-01 16:10
dirname.c1.33 kB06-04-02 13:14
error_msg.c1.14 kB06-12-01 16:19
error_msg_and_die.c1.17 kB06-12-01 16:10
fgets_str.c1.74 kB06-12-01 15:51
find_mount_point.c1.97 kB06-12-01 16:10
find_pid_by_name.c4.41 kB06-12-01 23:05
find_root_device.c2.14 kB06-12-01 16:10
full_read.c1.40 kB06-12-01 16:10
full_write.c1.34 kB06-12-01 16:10
get_console.c2.52 kB16-09-02 13:59
get_last_path_component.c1.43 kB06-12-01 16:23
get_line_from_file.c1.66 kB06-12-01 15:50
gz_open.c1.61 kB17-09-02 15:44
herror_msg.c1.08 kB06-12-01 16:10
herror_msg_and_die.c1.11 kB06-12-01 16:10
human_readable.c2.57 kB01-07-01 02:08
inode_hash.c2.74 kB19-09-02 03:21
interface.c48.50 kB17-09-02 14:36
isdirectory.c1.65 kB06-12-01 16:10
kernel_version.c1.53 kB06-12-01 16:10
last_char_is.c1.23 kB07-07-01 12:27
libbb.h11.18 kB19-09-02 03:21
libc5.c5.17 kB17-09-02 15:44
loop.c2.76 kB28-02-02 11:57
make_directory.c1.84 kB25-08-01 03:51
messages.c2.14 kB20-11-01 07:34
mode_string.c1.94 kB06-12-01 16:10
module_syscalls.c2.77 kB12-03-02 08:33
mtab.c3.05 kB06-12-01 16:10
mtab_file.c1.30 kB06-12-01 16:10
my_getgrgid.c1.26 kB06-12-01 16:10
my_getgrnam.c1.26 kB06-12-01 16:10
my_getpwnam.c1.25 kB06-12-01 16:10
my_getpwnamegid.c1.39 kB06-12-01 16:10
my_getpwuid.c1.25 kB06-12-01 16:10
parse_mode.c3.02 kB06-12-01 16:10
parse_number.c1.62 kB06-12-01 16:10
perror_msg.c1.12 kB06-12-01 16:10
perror_msg_and_die.c1.15 kB06-12-01 16:10
print_file.c1.40 kB16-05-01 01:48
process_escape_sequence.c1.83 kB10-04-01 06:48
read_package_field.c3.04 kB06-12-01 16:10
real_loop.h900.00 B19-04-01 06:23
recursive_action.c3.56 kB06-12-01 16:10
remove_file.c2.92 kB06-12-01 16:10
safe_read.c1.14 kB06-12-01 16:10
safe_strncpy.c1.17 kB06-12-01 16:10
simplify_path.c1.62 kB06-12-01 16:10
syscalls.c3.37 kB12-03-02 08:33
syslog_msg_with_name.c1.25 kB06-12-01 16:10
time_string.c1.42 kB06-12-01 16:10
trim.c1.22 kB06-12-01 16:10
u_signal_names.c5.63 kB06-12-01 16:10
unarchive.c18.86 kB06-04-02 12:33
unzip.c30.10 kB16-09-02 15:08
vdprintf.c1.17 kB07-06-02 01:37
verror_msg.c1.14 kB06-12-01 16:10
vherror_msg.c1.06 kB06-12-01 16:10
vperror_msg.c1.18 kB06-12-01 16:10
wfopen.c1.13 kB06-12-01 16:10
xfuncs.c2.13 kB13-04-02 22:44
xgetcwd.c1.17 kB22-08-01 13:35
xgethostbyname.c1.07 kB06-12-01 16:10
xreadlink.c756.00 B08-05-01 01:48
xregcomp.c1.29 kB06-12-01 16:10
<libbb>0.00 B22-08-06 10:49
.indent.pro871.00 B27-01-01 14:01
__getgrent.c4.31 kB13-04-02 23:29
__getpwent.c3.08 kB27-01-01 16:24
config.h2.28 kB27-01-01 14:01
fgetgrent.c1.05 kB27-01-01 16:24
fgetpwent.c1.05 kB27-01-01 16:24
getgrgid.c1.22 kB27-01-01 16:24
getgrnam.c1.31 kB27-01-01 16:24
getpw.c1.32 kB27-01-01 16:24
getpwnam.c1.33 kB27-01-01 16:24
getpwuid.c1.24 kB27-01-01 16:24
grent.c1.37 kB27-01-01 16:24
grp.h873.00 B27-01-01 16:24
initgroups.c1.95 kB16-09-02 14:28
putpwent.c1.23 kB10-09-02 13:22
pwd.h993.00 B27-01-01 16:24
pwent.c1.48 kB27-01-01 16:24
setgroups.c1.34 kB12-03-02 08:33
<pwd_grp>0.00 B22-08-06 10:49
depmod.pl5.32 kB20-11-01 07:57
inittab3.33 kB18-12-01 07:15
mk2knr.pl2.41 kB18-04-01 01:37
undeb1.26 kB13-12-00 00:49
unrpm1.06 kB26-06-01 09:19
<scripts>0.00 B22-08-06 10:49
.cvsignore110.00 B20-04-00 02:52
Makefile675.00 B22-08-00 07:01
cp_tests.mk8.73 kB12-12-00 01:33
ln_tests.mk1.39 kB05-03-00 05:19
multibuild.pl2.15 kB16-03-01 06:14
multifeat.pl2.36 kB16-03-01 06:14
mv_tests.mk3.81 kB12-12-00 01:33
sh.testcases1.90 kB19-10-02 06:18
syslog_test.c298.00 B20-04-00 02:52
testcases6.78 kB28-08-01 02:55
tester.sh3.95 kB25-05-01 05:24
tst-syslogd.c837.00 B13-03-01 04:00
<tests>0.00 B22-08-06 10:49
<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