├── .gitignore ├── .indent.pro ├── AUTHORS ├── Android.mk ├── CleanSpec.mk ├── Config.in ├── INSTALL ├── LICENSE ├── Makefile ├── Makefile.custom ├── Makefile.flags ├── Makefile.help ├── README ├── TODO ├── TODO_unicode ├── android ├── android.c ├── libc │ ├── __set_errno.c │ ├── arch-arm │ │ └── syscalls │ │ │ ├── swapoff.S │ │ │ ├── swapon.S │ │ │ └── sysinfo.S │ ├── arch-mips │ │ └── syscalls │ │ │ ├── swapoff.S │ │ │ ├── swapon.S │ │ │ └── sysinfo.S │ ├── arch-x86 │ │ └── syscalls │ │ │ ├── swapoff.S │ │ │ ├── swapon.S │ │ │ └── sysinfo.S │ ├── mktemp.c │ └── pty.c ├── librpc.sources ├── librpc │ ├── auth_none.c │ ├── auth_unix.c │ ├── authunix_prot.c │ ├── bindresvport.c │ ├── clnt_generic.c │ ├── clnt_perror.c │ ├── clnt_raw.c │ ├── clnt_simple.c │ ├── clnt_tcp.c │ ├── clnt_udp.c │ ├── clnt_unix.c │ ├── create_xid.c │ ├── errqueue.h │ ├── get_myaddress.c │ ├── getrpcent.c │ ├── getrpcport.c │ ├── libintl.h │ ├── pm_getmaps.c │ ├── pm_getport.c │ ├── pmap_clnt.c │ ├── pmap_prot.c │ ├── pmap_prot2.c │ ├── pmap_rmt.c │ ├── rpc │ │ ├── auth.h │ │ ├── auth_des.h │ │ ├── auth_unix.h │ │ ├── clnt.h │ │ ├── des_crypt.h │ │ ├── key_prot.h │ │ ├── netdb.h │ │ ├── pmap_clnt.h │ │ ├── pmap_prot.h │ │ ├── pmap_rmt.h │ │ ├── rpc.h │ │ ├── rpc_des.h │ │ ├── rpc_msg.h │ │ ├── svc.h │ │ ├── svc_auth.h │ │ ├── types.h │ │ └── xdr.h │ ├── rpc_cmsg.c │ ├── rpc_commondata.c │ ├── rpc_dtablesize.c │ ├── rpc_private.h │ ├── rpc_prot.c │ ├── rpc_thread.c │ ├── svc.c │ ├── svc_auth.c │ ├── svc_authux.c │ ├── svc_raw.c │ ├── svc_run.c │ ├── svc_simple.c │ ├── svc_tcp.c │ ├── svc_udp.c │ ├── svc_unix.c │ ├── xdr.c │ ├── xdr_array.c │ ├── xdr_float.c │ ├── xdr_intXX_t.c │ ├── xdr_mem.c │ ├── xdr_rec.c │ ├── xdr_reference.c │ └── xdr_stdio.c ├── reboot.c ├── regex │ ├── bb_regex.c │ ├── bb_regex.h │ └── cs_config.h └── selinux │ ├── android_selinux.h │ ├── android_selinux_internal.h │ ├── matchpathcon.c │ └── stubs.c ├── applets ├── .gitignore ├── Kbuild.src ├── applet_tables.c ├── applets.c ├── busybox.mkll ├── busybox.mksuid ├── individual.c ├── install.sh ├── usage.c ├── usage_compressed └── usage_pod.c ├── applets_sh ├── README ├── dos2unix ├── nologin ├── tac └── unix2dos ├── arch └── i386 │ └── Makefile ├── archival ├── Config.src ├── Kbuild.src ├── ar.c ├── bbunzip.c ├── bbunzip_test.sh ├── bbunzip_test2.sh ├── bbunzip_test3.sh ├── bzip2.c ├── cpio.c ├── dpkg.c ├── dpkg_deb.c ├── gzip.c ├── libarchive │ ├── Kbuild.src │ ├── bz │ │ ├── LICENSE │ │ ├── README │ │ ├── blocksort.c │ │ ├── bzlib.c │ │ ├── bzlib.h │ │ ├── bzlib_private.h │ │ ├── compress.c │ │ └── huffman.c │ ├── data_align.c │ ├── data_extract_all.c │ ├── data_extract_to_command.c │ ├── data_extract_to_stdout.c │ ├── data_skip.c │ ├── decompress_bunzip2.c │ ├── decompress_gunzip.c │ ├── decompress_uncompress.c │ ├── decompress_unlzma.c │ ├── decompress_unxz.c │ ├── filter_accept_all.c │ ├── filter_accept_list.c │ ├── filter_accept_list_reassign.c │ ├── filter_accept_reject_list.c │ ├── find_list_entry.c │ ├── get_header_ar.c │ ├── get_header_cpio.c │ ├── get_header_tar.c │ ├── get_header_tar_bz2.c │ ├── get_header_tar_gz.c │ ├── get_header_tar_lzma.c │ ├── header_list.c │ ├── header_skip.c │ ├── header_verbose_list.c │ ├── init_handle.c │ ├── liblzo.h │ ├── lzo1x_1.c │ ├── lzo1x_1o.c │ ├── lzo1x_9x.c │ ├── lzo1x_c.c │ ├── lzo1x_d.c │ ├── open_transformer.c │ ├── seek_by_jump.c │ ├── seek_by_read.c │ ├── unpack_ar_archive.c │ └── unxz │ │ ├── README │ │ ├── xz.h │ │ ├── xz_config.h │ │ ├── xz_dec_bcj.c │ │ ├── xz_dec_lzma2.c │ │ ├── xz_dec_stream.c │ │ ├── xz_lzma2.h │ │ ├── xz_private.h │ │ └── xz_stream.h ├── lzop.c ├── rpm.c ├── rpm.h ├── rpm2cpio.c ├── tar.c └── unzip.c ├── busybox-full.config ├── busybox-full.links ├── busybox-full.sources ├── busybox-minimal.config ├── busybox-minimal.links ├── busybox-minimal.sources ├── busybox-xposed.config ├── busybox-xposed.links ├── busybox-xposed.sources ├── configs ├── TEST_nommu_defconfig ├── TEST_noprintf_defconfig ├── TEST_rh9_defconfig ├── android2_defconfig ├── android_defconfig ├── android_ndk_defconfig ├── cygwin_defconfig └── freebsd_defconfig ├── console-tools ├── Config.src ├── Kbuild.src ├── chvt.c ├── clear.c ├── deallocvt.c ├── dumpkmap.c ├── fgconsole.c ├── kbd_mode.c ├── loadfont.c ├── loadkmap.c ├── openvt.c ├── reset.c ├── resize.c ├── setconsole.c ├── setkeycodes.c ├── setlogcons.c └── showkey.c ├── coreutils ├── Config.src ├── Kbuild.src ├── basename.c ├── cal.c ├── cat.c ├── catv.c ├── chgrp.c ├── chmod.c ├── chown.c ├── chroot.c ├── cksum.c ├── comm.c ├── cp.c ├── cut.c ├── date.c ├── dd.c ├── df.c ├── dirname.c ├── dos2unix.c ├── du.c ├── echo.c ├── env.c ├── expand.c ├── expr.c ├── false.c ├── fold.c ├── fsync.c ├── head.c ├── hostid.c ├── id.c ├── id_test.sh ├── install.c ├── length.c.disabled ├── libcoreutils │ ├── Kbuild.src │ ├── coreutils.h │ ├── cp_mv_stat.c │ └── getopt_mk_fifo_nod.c ├── ln.c ├── logname.c ├── ls.c ├── md5_sha1_sum.c ├── mkdir.c ├── mkfifo.c ├── mknod.c ├── mv.c ├── nice.c ├── nohup.c ├── od.c ├── od_bloaty.c ├── printenv.c ├── printf.c ├── pwd.c ├── readlink.c ├── realpath.c ├── rm.c ├── rmdir.c ├── seq.c ├── sleep.c ├── sort.c ├── split.c ├── stat.c ├── stty.c ├── sum.c ├── sync.c ├── tac.c ├── tail.c ├── tee.c ├── test.c ├── test_ptr_hack.c ├── touch.c ├── tr.c ├── true.c ├── tty.c ├── uname.c ├── uniq.c ├── usleep.c ├── uudecode.c ├── uuencode.c ├── wc.c ├── who.c ├── whoami.c └── yes.c ├── debianutils ├── Config.src ├── Kbuild.src ├── mktemp.c ├── pipe_progress.c ├── run_parts.c ├── start_stop_daemon.c └── which.c ├── docs ├── .gitignore ├── Serial-Programming-HOWTO.txt ├── busybox_footer.pod ├── busybox_header.pod ├── cgi │ ├── cl.html │ ├── env.html │ ├── in.html │ ├── interface.html │ └── out.html ├── contributing.txt ├── ctty.htm ├── draft-coar-cgi-v11-03-clean.html ├── ifupdown_design.txt ├── keep_data_small.txt ├── logging_and_backgrounding.txt ├── mdev.txt ├── new-applet-HOWTO.txt ├── nofork_noexec.txt ├── posix_conformance.txt ├── sigint.htm ├── smallint.txt ├── style-guide.txt ├── syslog.conf.txt ├── tar_pax.txt ├── tcp.txt ├── unicode.txt ├── unicode_UTF-8-test.txt └── unicode_full-bmp.txt ├── e2fsprogs ├── Config.src ├── Kbuild.src ├── README ├── chattr.c ├── e2fs_lib.c ├── e2fs_lib.h ├── fsck.c ├── lsattr.c ├── old_e2fsprogs │ ├── Config.src │ ├── Kbuild.src │ ├── README │ ├── blkid │ │ ├── Kbuild.src │ │ ├── blkid.h │ │ ├── blkidP.h │ │ ├── blkid_getsize.c │ │ ├── cache.c │ │ ├── dev.c │ │ ├── devname.c │ │ ├── devno.c │ │ ├── list.c │ │ ├── list.h │ │ ├── probe.c │ │ ├── probe.h │ │ ├── read.c │ │ ├── resolve.c │ │ ├── save.c │ │ └── tag.c │ ├── chattr.c │ ├── e2fsbb.h │ ├── e2fsck.c │ ├── e2fsck.h │ ├── e2p │ │ ├── Kbuild.src │ │ ├── e2p.h │ │ ├── feature.c │ │ ├── fgetsetflags.c │ │ ├── fgetsetversion.c │ │ ├── hashstr.c │ │ ├── iod.c │ │ ├── ls.c │ │ ├── mntopts.c │ │ ├── ostype.c │ │ ├── parse_num.c │ │ ├── pe.c │ │ ├── pf.c │ │ ├── ps.c │ │ └── uuid.c │ ├── ext2fs │ │ ├── Kbuild.src │ │ ├── alloc.c │ │ ├── alloc_sb.c │ │ ├── alloc_stats.c │ │ ├── alloc_tables.c │ │ ├── badblocks.c │ │ ├── bb_compat.c │ │ ├── bb_inode.c │ │ ├── bitmaps.c │ │ ├── bitops.c │ │ ├── bitops.h │ │ ├── block.c │ │ ├── bmap.c │ │ ├── bmove.c │ │ ├── brel.h │ │ ├── brel_ma.c │ │ ├── check_desc.c │ │ ├── closefs.c │ │ ├── cmp_bitmaps.c │ │ ├── dblist.c │ │ ├── dblist_dir.c │ │ ├── dir_iterate.c │ │ ├── dirblock.c │ │ ├── dirhash.c │ │ ├── dupfs.c │ │ ├── e2image.h │ │ ├── expanddir.c │ │ ├── ext2_err.h │ │ ├── ext2_ext_attr.h │ │ ├── ext2_fs.h │ │ ├── ext2_io.h │ │ ├── ext2_types.h │ │ ├── ext2fs.h │ │ ├── ext2fsP.h │ │ ├── ext2fs_inline.c │ │ ├── ext_attr.c │ │ ├── fileio.c │ │ ├── finddev.c │ │ ├── flushb.c │ │ ├── freefs.c │ │ ├── gen_bitmap.c │ │ ├── get_pathname.c │ │ ├── getsectsize.c │ │ ├── getsize.c │ │ ├── icount.c │ │ ├── imager.c │ │ ├── ind_block.c │ │ ├── initialize.c │ │ ├── inline.c │ │ ├── inode.c │ │ ├── inode_io.c │ │ ├── io_manager.c │ │ ├── irel.h │ │ ├── irel_ma.c │ │ ├── ismounted.c │ │ ├── jfs_dat.h │ │ ├── kernel-jbd.h │ │ ├── kernel-list.h │ │ ├── link.c │ │ ├── lookup.c │ │ ├── mkdir.c │ │ ├── mkjournal.c │ │ ├── namei.c │ │ ├── newdir.c │ │ ├── openfs.c │ │ ├── read_bb.c │ │ ├── read_bb_file.c │ │ ├── res_gdt.c │ │ ├── rs_bitmap.c │ │ ├── rw_bitmaps.c │ │ ├── sparse.c │ │ ├── swapfs.c │ │ ├── test_io.c │ │ ├── unix_io.c │ │ ├── unlink.c │ │ ├── valid_blk.c │ │ ├── version.c │ │ └── write_bb_file.c │ ├── fsck.c │ ├── fsck.h │ ├── lsattr.c │ ├── mke2fs.c │ ├── tune2fs.c │ ├── util.c │ ├── util.h │ └── uuid │ │ ├── Kbuild.src │ │ ├── compare.c │ │ ├── gen_uuid.c │ │ ├── pack.c │ │ ├── parse.c │ │ ├── unpack.c │ │ ├── unparse.c │ │ ├── uuid.h │ │ ├── uuidP.h │ │ └── uuid_time.c └── tune2fs.c ├── editors ├── Config.src ├── Kbuild.src ├── awk.c ├── cmp.c ├── diff.c ├── ed.c ├── patch.c ├── patch_bbox.c ├── patch_toybox.c ├── sed.c ├── sed1line.txt ├── sed_summary.htm └── vi.c ├── examples ├── android-build ├── bootfloppy │ ├── bootfloppy.txt │ ├── display.txt │ ├── etc │ │ ├── fstab │ │ ├── init.d │ │ │ └── rcS │ │ ├── inittab │ │ └── profile │ ├── mkdevs.sh │ ├── mkrootfs.sh │ ├── mksyslinux.sh │ ├── quickstart.txt │ └── syslinux.cfg ├── busybox.spec ├── depmod ├── depmod.pl ├── devfsd.conf ├── dnsd.conf ├── inetd.conf ├── inittab ├── linux-2.6.30_proc_self_exe.patch ├── mdev.conf ├── mdev.conf.change_blockdev.sh ├── mdev_fat.conf ├── mk2knr.pl ├── udhcp │ ├── sample.bound │ ├── sample.deconfig │ ├── sample.nak │ ├── sample.renew │ ├── sample.script │ ├── simple.script │ └── udhcpd.conf ├── undeb ├── unrpm ├── var_service │ ├── README │ ├── dhcp_if │ │ ├── convert2ipconf │ │ ├── convert2ntpconf │ │ ├── dhcp_handler │ │ ├── log │ │ │ └── run │ │ ├── p_log │ │ ├── run │ │ └── w_log │ ├── dhcp_if_pinger │ │ └── run │ ├── ftpd │ │ ├── log │ │ │ └── run │ │ ├── p_log │ │ ├── run │ │ └── w_log │ ├── fw │ │ ├── conf │ │ │ ├── 11.22.33.44.ipconf-- │ │ │ ├── 192.168.0.1.ipconf │ │ │ └── lo.ipconf │ │ ├── etc │ │ │ ├── hosts │ │ │ └── resolv.conf │ │ ├── run │ │ └── stat │ ├── getty_tty1 │ │ ├── alt08x16+unimap.fnt │ │ ├── cfg │ │ ├── koi8r_to_uni.trans │ │ ├── login.sh │ │ ├── ru_koi8r.keymap │ │ └── run │ ├── gpm │ │ └── run │ ├── httpd │ │ ├── log │ │ │ └── run │ │ ├── p_log │ │ ├── run │ │ └── w_log │ ├── ifplugd_if │ │ ├── ifplugd_handler │ │ ├── log │ │ │ └── run │ │ ├── p_log │ │ ├── run │ │ └── w_log │ ├── inetd │ │ ├── inetd.conf │ │ ├── log │ │ │ └── run │ │ ├── p_log │ │ ├── run │ │ └── w_log │ ├── nmeter │ │ └── run │ ├── ntpd │ │ ├── log │ │ │ └── run │ │ ├── ntp.script │ │ ├── p_log │ │ ├── run │ │ └── w_log │ └── tftpd │ │ ├── log │ │ └── run │ │ ├── p_log │ │ ├── run │ │ └── w_log └── zcip.script ├── findutils ├── Config.src ├── Kbuild.src ├── find.c ├── grep.c └── xargs.c ├── include ├── .gitignore ├── android.h ├── applet_metadata.h ├── applets.src.h ├── ar.h ├── bb_archive.h ├── bb_e2fs_defs.h ├── busybox.h ├── dump.h ├── fix_u32.h ├── grp_.h ├── inet_common.h ├── libbb.h ├── liblzo_interface.h ├── platform.h ├── pwd_.h ├── rtc_.h ├── shadow_.h ├── unicode.h ├── usage.src.h ├── volume_id.h ├── xatonum.h └── xregex.h ├── init ├── Config.src ├── Kbuild.src ├── bootchartd.c ├── halt.c ├── init.c ├── mesg.c └── reboot.h ├── libbb ├── Config.src ├── Kbuild.src ├── README ├── appletlib.c ├── ask_confirmation.c ├── bb_askpass.c ├── bb_bswap_64.c ├── bb_do_delay.c ├── bb_pwd.c ├── bb_qsort.c ├── bb_strtod.c ├── bb_strtonum.c ├── change_identity.c ├── chomp.c ├── compare_string_array.c ├── concat_path_file.c ├── concat_subpath_file.c ├── copy_file.c ├── copyfd.c ├── correct_password.c ├── crc32.c ├── default_error_retval.c ├── device_open.c ├── die_if_bad_username.c ├── dump.c ├── endofname.c ├── execable.c ├── fclose_nonstdin.c ├── fflush_stdout_and_exit.c ├── fgets_str.c ├── find_mount_point.c ├── find_pid_by_name.c ├── find_root_device.c ├── full_write.c ├── get_console.c ├── get_cpu_count.c ├── get_last_path_component.c ├── get_line_from_file.c ├── get_shell_name.c ├── get_volsize.c ├── getopt32.c ├── getpty.c ├── hash_md5_sha.c ├── hash_md5prime.c ├── herror_msg.c ├── human_readable.c ├── in_ether.c ├── inet_cksum.c ├── inet_common.c ├── info_msg.c ├── inode_hash.c ├── isdirectory.c ├── kernel_version.c ├── last_char_is.c ├── lineedit.c ├── lineedit_ptr_hack.c ├── llist.c ├── login.c ├── loop.c ├── make_directory.c ├── makedev.c ├── match_fstype.c ├── messages.c ├── missing_syscalls.c ├── mode_string.c ├── mtab.c ├── nuke_str.c ├── obscure.c ├── parse_config.c ├── parse_mode.c ├── percent_decode.c ├── perror_msg.c ├── perror_nomsg.c ├── perror_nomsg_and_die.c ├── pidfile.c ├── platform.c ├── print_flags.c ├── printable.c ├── printable_string.c ├── process_escape_sequence.c ├── procps.c ├── progress.c ├── ptr_to_globals.c ├── pw_encrypt.c ├── pw_encrypt_des.c ├── pw_encrypt_md5.c ├── pw_encrypt_sha.c ├── read.c ├── read_key.c ├── read_printf.c ├── recursive_action.c ├── remove_file.c ├── rtc.c ├── run_shell.c ├── safe_gethostname.c ├── safe_poll.c ├── safe_strncpy.c ├── safe_write.c ├── selinux_common.c ├── setup_environment.c ├── signals.c ├── simplify_path.c ├── single_argv.c ├── skip_whitespace.c ├── speed_table.c ├── str_tolower.c ├── strrstr.c ├── systemd_support.c ├── time.c ├── trim.c ├── u_signal_names.c ├── udp_io.c ├── unicode.c ├── update_passwd.c ├── utmp.c ├── uuencode.c ├── vdprintf.c ├── verror_msg.c ├── vfork_daemon_rexec.c ├── warn_ignoring_args.c ├── wfopen.c ├── wfopen_input.c ├── write.c ├── xatonum.c ├── xatonum_template.c ├── xconnect.c ├── xfunc_die.c ├── xfuncs.c ├── xfuncs_printf.c ├── xgetcwd.c ├── xgethostbyname.c ├── xreadlink.c ├── xrealloc_vector.c └── xregcomp.c ├── libpwdgrp ├── Kbuild.src ├── pwd_grp.c ├── pwd_grp_internal.c └── uidgid_get.c ├── loginutils ├── Config.src ├── Kbuild.src ├── README ├── add-remove-shell.c ├── addgroup.c ├── adduser.c ├── chpasswd.c ├── cryptpw.c ├── deluser.c ├── getty.c ├── login.c ├── passwd.c ├── su.c ├── sulogin.c └── vlock.c ├── mailutils ├── Config.src ├── Kbuild.src ├── mail.c ├── mail.h ├── makemime.c ├── popmaildir.c ├── reformime.c └── sendmail.c ├── miscutils ├── Config.src ├── Kbuild.src ├── adjtimex.c ├── bbconfig.c ├── beep.c ├── chat.c ├── chrt.c ├── conspy.c ├── crond.c ├── crontab.c ├── dc.c ├── devfsd.c ├── devmem.c ├── eject.c ├── fbsplash.c ├── fbsplash.cfg ├── flash_eraseall.c ├── flash_lock_unlock.c ├── flashcp.c ├── hdparm.c ├── inotifyd.c ├── ionice.c ├── last.c ├── last_fancy.c ├── less.c ├── makedevs.c ├── man.c ├── microcom.c ├── mountpoint.c ├── mt.c ├── nandwrite.c ├── raidautorun.c ├── readahead.c ├── rfkill.c ├── runlevel.c ├── rx.c ├── setserial.c ├── setsid.c ├── strings.c ├── taskset.c ├── time.c ├── timeout.c ├── ttysize.c ├── ubi_tools.c ├── volname.c ├── wall.c └── watchdog.c ├── modutils ├── Config.src ├── Kbuild.src ├── depmod.c ├── depmod_process.sh ├── insmod.c ├── lsmod.c ├── modinfo.c ├── modprobe-small.c ├── modprobe.c ├── modutils-24.c ├── modutils.c ├── modutils.h └── rmmod.c ├── networking ├── Config.src ├── Kbuild.src ├── arp.c ├── arping.c ├── brctl.c ├── dnsd.c ├── ether-wake.c ├── ftpd.c ├── ftpgetput.c ├── hostname.c ├── httpd.c ├── httpd_indexcgi.c ├── httpd_post_upload.txt ├── httpd_ssi.c ├── ifconfig.c ├── ifenslave.c ├── ifplugd.c ├── ifupdown.c ├── inetd.c ├── interface.c ├── ip.c ├── ipcalc.c ├── ipv6 │ ├── icmp6.h │ └── ip6.h ├── isrv.c ├── isrv.h ├── isrv_identd.c ├── libiproute │ ├── Kbuild.src │ ├── ip_common.h │ ├── ip_parse_common_args.c │ ├── ipaddress.c │ ├── iplink.c │ ├── iproute.c │ ├── iprule.c │ ├── iptunnel.c │ ├── libnetlink.c │ ├── libnetlink.h │ ├── ll_addr.c │ ├── ll_map.c │ ├── ll_map.h │ ├── ll_proto.c │ ├── ll_types.c │ ├── rt_names.c │ ├── rt_names.h │ ├── rtm_map.c │ ├── rtm_map.h │ ├── utils.c │ └── utils.h ├── nameif.c ├── nbd-client.c ├── nc.c ├── nc_bloaty.c ├── netstat.c ├── nslookup.c ├── ntpd.c ├── ntpd_simple.c ├── ping.c ├── pscan.c ├── route.c ├── slattach.c ├── tc.c ├── tcpudp.c ├── tcpudp_perhost.c ├── tcpudp_perhost.h ├── telnet.c ├── telnetd.c ├── telnetd.ctrlSQ.patch ├── tftp.c ├── traceroute.c ├── tunctl.c ├── udhcp │ ├── Config.src │ ├── Kbuild.src │ ├── arpping.c │ ├── common.c │ ├── common.h │ ├── d6_common.h │ ├── d6_dhcpc.c │ ├── d6_packet.c │ ├── d6_socket.c │ ├── dhcpc.c │ ├── dhcpc.h │ ├── dhcpd.c │ ├── dhcpd.h │ ├── dhcprelay.c │ ├── domain_codec.c │ ├── dumpleases.c │ ├── files.c │ ├── leases.c │ ├── packet.c │ ├── signalpipe.c │ ├── socket.c │ └── static_leases.c ├── vconfig.c ├── wget.c ├── whois.c └── zcip.c ├── printutils ├── Config.src ├── Kbuild.src ├── lpd.c └── lpr.c ├── procps ├── Config.src ├── Kbuild.src ├── free.c ├── fuser.c ├── iostat.c ├── kill.c ├── lsof.c ├── mpstat.c ├── nmeter.c ├── pgrep.c ├── pidof.c ├── pmap.c ├── powertop.c ├── ps.c ├── ps.posix ├── pstree.c ├── pwdx.c ├── renice.c ├── smemcap.c ├── sysctl.c ├── top.c ├── uptime.c └── watch.c ├── runit ├── Config.src ├── Kbuild.src ├── chpst.c ├── runit_lib.h ├── runsv.c ├── runsvdir.c ├── sv.c └── svlogd.c ├── scripts ├── Kbuild.include ├── Kbuild.src ├── Makefile.IMA ├── Makefile.build ├── Makefile.clean ├── Makefile.host ├── Makefile.lib ├── basic │ ├── .gitignore │ ├── Makefile │ ├── docproc.c │ ├── fixdep.c │ └── split-include.c ├── bb_release ├── bloat-o-meter ├── checkhelp.awk ├── checkstack.pl ├── cleanup_printf2puts ├── echo.c ├── find_bad_common_bufsiz ├── find_stray_common_vars ├── find_stray_empty_lines ├── fix_ws.sh ├── gcc-version.sh ├── gen_build_files.sh ├── kconfig │ ├── .gitignore │ ├── Makefile │ ├── POTFILES.in │ ├── check.sh │ ├── conf.c │ ├── confdata.c │ ├── expr.c │ ├── expr.h │ ├── gconf.c │ ├── gconf.glade │ ├── images.c │ ├── kconfig_load.c │ ├── kxgettext.c │ ├── lex.zconf.c_shipped │ ├── lkc.h │ ├── lkc_proto.h │ ├── lxdialog │ │ ├── .gitignore │ │ ├── BIG.FAT.WARNING │ │ ├── Makefile │ │ ├── check-lxdialog.sh │ │ ├── checklist.c │ │ ├── colors.h │ │ ├── dialog.h │ │ ├── inputbox.c │ │ ├── lxdialog.c │ │ ├── menubox.c │ │ ├── msgbox.c │ │ ├── textbox.c │ │ ├── util.c │ │ └── yesno.c │ ├── mconf.c │ ├── menu.c │ ├── qconf.cc │ ├── qconf.h │ ├── symbol.c │ ├── util.c │ ├── zconf.gperf │ ├── zconf.hash.c_shipped │ ├── zconf.l │ ├── zconf.tab.c_shipped │ └── zconf.y ├── memusage ├── mkconfigs ├── mkdiff_obj ├── mkdiff_obj_bloat ├── mkmakefile ├── objsizes ├── randomtest ├── randomtest.loop ├── sample_pmap ├── showasm ├── test_make_O ├── test_make_clean └── trylink ├── selinux ├── Config.src ├── Kbuild.src ├── chcon.c ├── getenforce.c ├── getsebool.c ├── load_policy.c ├── matchpathcon.c ├── runcon.c ├── selinuxenabled.c ├── sestatus.c ├── setenforce.c ├── setfiles.c └── setsebool.c ├── shell ├── Config.src ├── Kbuild.src ├── README ├── README.job ├── ash.c ├── ash_doc.txt ├── ash_ptr_hack.c ├── ash_test │ ├── ash-alias │ │ ├── alias.right │ │ └── alias.tests │ ├── ash-arith │ │ ├── README.ash │ │ ├── arith-bash1.right │ │ ├── arith-bash1.tests │ │ ├── arith-for.right │ │ ├── arith-for.testsx │ │ ├── arith.right │ │ ├── arith.tests │ │ ├── arith1.sub │ │ └── arith2.sub │ ├── ash-heredoc │ │ ├── heredoc.right │ │ └── heredoc.tests │ ├── ash-invert │ │ ├── invert.right │ │ └── invert.tests │ ├── ash-misc │ │ ├── echo_write_error.right │ │ ├── echo_write_error.tests │ │ ├── last_amp.right │ │ ├── last_amp.tests │ │ ├── nulltick1.right │ │ ├── nulltick1.tests │ │ ├── shift1.right │ │ ├── shift1.tests │ │ ├── source1.right │ │ ├── source1.tests │ │ ├── source2.right │ │ └── source2.tests │ ├── ash-quoting │ │ ├── dollar_repl_slash_bash1.right │ │ ├── dollar_repl_slash_bash1.tests │ │ ├── dollar_squote_bash1.right │ │ └── dollar_squote_bash1.tests │ ├── ash-read │ │ ├── read_REPLY.right │ │ ├── read_REPLY.tests │ │ ├── read_ifs.right │ │ ├── read_ifs.tests │ │ ├── read_n.right │ │ ├── read_n.tests │ │ ├── read_r.right │ │ ├── read_r.tests │ │ ├── read_t.right │ │ └── read_t.tests │ ├── ash-redir │ │ ├── redir.right │ │ ├── redir.tests │ │ ├── redir2.right │ │ ├── redir2.tests │ │ ├── redir3.right │ │ ├── redir3.tests │ │ ├── redir4.right │ │ ├── redir4.tests │ │ ├── redir5.right │ │ ├── redir5.tests │ │ ├── redir6.right │ │ ├── redir6.tests │ │ ├── redir7.right │ │ ├── redir7.tests │ │ ├── redir8.right │ │ ├── redir8.tests │ │ ├── redir9.right │ │ ├── redir9.tests │ │ ├── redirA.right │ │ └── redirA.tests │ ├── ash-signals │ │ ├── reap1.right │ │ ├── reap1.tests │ │ ├── savetrap.right │ │ ├── savetrap.tests │ │ ├── sigint1.right │ │ ├── sigint1.tests │ │ ├── signal1.right │ │ ├── signal1.tests │ │ ├── signal2.right │ │ ├── signal2.tests │ │ ├── signal3.right │ │ ├── signal3.tests │ │ ├── signal4.right │ │ ├── signal4.tests │ │ ├── signal5.right │ │ ├── signal5.tests │ │ ├── signal6.right │ │ ├── signal6.tests │ │ ├── signal7.right │ │ ├── signal7.tests │ │ ├── signal8.right │ │ ├── signal8.tests │ │ ├── signal9.right │ │ └── signal9.tests │ ├── ash-standalone │ │ ├── noexec_gets_no_env.right │ │ ├── noexec_gets_no_env.tests │ │ ├── nofork_trashes_getopt.right │ │ ├── nofork_trashes_getopt.tests │ │ ├── var_standalone1.right │ │ └── var_standalone1.tests │ ├── ash-vars │ │ ├── var1.right │ │ ├── var1.tests │ │ ├── var2.right │ │ ├── var2.tests │ │ ├── var_bash1.right │ │ ├── var_bash1.tests │ │ ├── var_bash2.right │ │ ├── var_bash2.tests │ │ ├── var_bash3.right │ │ ├── var_bash3.tests │ │ ├── var_bash4.right │ │ ├── var_bash4.tests │ │ ├── var_bash5.right │ │ ├── var_bash5.tests │ │ ├── var_leak.right │ │ ├── var_leak.tests │ │ ├── var_posix1.right │ │ └── var_posix1.tests │ ├── printenv.c │ ├── recho.c │ ├── run-all │ └── zecho.c ├── brace.txt ├── cttyhack.c ├── hush.c ├── hush_doc.txt ├── hush_leaktool.sh ├── hush_test │ ├── .gitignore │ ├── hush-arith │ │ ├── arith.right │ │ ├── arith.tests │ │ ├── arith1.sub │ │ └── arith2.sub │ ├── hush-bugs │ │ ├── and_or_and_backgrounding.right │ │ ├── and_or_and_backgrounding.tests │ │ ├── export_exp.right │ │ └── export_exp.tests.disabled │ ├── hush-glob │ │ ├── bash_brace1.right │ │ ├── bash_brace1.tests │ │ ├── glob1.right │ │ ├── glob1.tests │ │ ├── glob2.right │ │ ├── glob2.tests │ │ ├── glob_and_assign.right │ │ ├── glob_and_assign.tests │ │ ├── glob_redir.right │ │ └── glob_redir.tests │ ├── hush-leak │ │ ├── leak_argv1.right │ │ └── leak_argv1.tests │ ├── hush-misc │ │ ├── and-or.right │ │ ├── and-or.tests │ │ ├── assignment1.right │ │ ├── assignment1.tests │ │ ├── assignment2.rigth │ │ ├── assignment2.tests │ │ ├── assignment3.right │ │ ├── assignment3.tests │ │ ├── assignment4.right │ │ ├── assignment4.tests │ │ ├── break1.right │ │ ├── break1.tests │ │ ├── break2.right │ │ ├── break2.tests │ │ ├── break3.right │ │ ├── break3.tests │ │ ├── break4.right │ │ ├── break4.tests │ │ ├── break5.right │ │ ├── break5.tests │ │ ├── builtin1.right │ │ ├── builtin1.tests │ │ ├── case1.right │ │ ├── case1.tests │ │ ├── colon.right │ │ ├── colon.tests │ │ ├── compound.right │ │ ├── compound.tests │ │ ├── continue1.right │ │ ├── continue1.tests │ │ ├── continue2.right │ │ ├── continue2.tests │ │ ├── continue3.right │ │ ├── continue3.tests │ │ ├── echo_write_error.right │ │ ├── echo_write_error.tests │ │ ├── empty_args.right │ │ ├── empty_args.tests │ │ ├── empty_for.right │ │ ├── empty_for.tests │ │ ├── empty_for2.right │ │ ├── empty_for2.tests │ │ ├── env_and_func.right │ │ ├── env_and_func.tests │ │ ├── exec.right │ │ ├── exec.tests │ │ ├── exit1.right │ │ ├── exit1.tests │ │ ├── export-n.right │ │ ├── export-n.tests │ │ ├── export.right │ │ ├── export.tests │ │ ├── for_with_bslashes.right │ │ ├── for_with_bslashes.tests │ │ ├── for_with_keywords.right │ │ ├── for_with_keywords.tests │ │ ├── func1.right │ │ ├── func1.tests │ │ ├── func2.right │ │ ├── func2.tests │ │ ├── func3.right │ │ ├── func3.tests │ │ ├── func4.right │ │ ├── func4.tests │ │ ├── func5.right │ │ ├── func5.tests │ │ ├── func_args1.right │ │ ├── func_args1.tests │ │ ├── func_local1.right │ │ ├── func_local1.tests │ │ ├── func_local2.right │ │ ├── func_local2.tests │ │ ├── heredoc1.right │ │ ├── heredoc1.tests │ │ ├── heredoc2.right │ │ ├── heredoc2.tests │ │ ├── heredoc3.right │ │ ├── heredoc3.tests │ │ ├── heredoc_backslash1.right │ │ ├── heredoc_backslash1.tests │ │ ├── heredoc_huge.right │ │ ├── heredoc_huge.tests │ │ ├── if_false_exitcode.right │ │ ├── if_false_exitcode.tests │ │ ├── nommu1.right │ │ ├── nommu1.tests │ │ ├── nommu2.right │ │ ├── nommu2.tests │ │ ├── opts1.right │ │ ├── opts1.tests │ │ ├── pid.right │ │ ├── pid.tests │ │ ├── pipefail.right │ │ ├── pipefail.tests │ │ ├── read.right │ │ ├── read.tests │ │ ├── redir1.right │ │ ├── redir1.tests │ │ ├── redir2.right │ │ ├── redir2.tests │ │ ├── redir3.right │ │ ├── redir3.tests │ │ ├── redir4.right │ │ ├── redir4.tests │ │ ├── redir5.right │ │ ├── redir5.tests │ │ ├── redir6.right │ │ ├── redir6.tests │ │ ├── return1.right │ │ ├── return1.tests │ │ ├── shift.right │ │ ├── shift.tests │ │ ├── sig_exitcode.right │ │ ├── sig_exitcode.tests │ │ ├── sigint1.right │ │ ├── sigint1.tests │ │ ├── source1.right │ │ ├── source1.tests │ │ ├── source2.right │ │ ├── source2.tests │ │ ├── syntax_err.right │ │ ├── syntax_err.tests │ │ ├── syntax_err_negate.right │ │ ├── syntax_err_negate.tests │ │ ├── until1.right │ │ ├── until1.tests │ │ ├── while1.right │ │ ├── while1.tests │ │ ├── while2.right │ │ ├── while2.tests │ │ ├── while3.right │ │ ├── while3.tests │ │ ├── while4.right │ │ ├── while4.tests │ │ ├── while_in_subshell.right │ │ └── while_in_subshell.tests │ ├── hush-parsing │ │ ├── argv0.right │ │ ├── argv0.tests │ │ ├── brace1.right │ │ ├── brace1.tests │ │ ├── brace2.right │ │ ├── brace2.tests │ │ ├── comment1.right │ │ ├── comment1.tests │ │ ├── eol1.right │ │ ├── eol1.tests │ │ ├── escape1.right │ │ ├── escape1.tests │ │ ├── escape2.right │ │ ├── escape2.tests │ │ ├── escape3.right │ │ ├── escape3.tests │ │ ├── escape4.right │ │ ├── escape4.tests │ │ ├── escape5.right │ │ ├── escape5.tests │ │ ├── group1.right │ │ ├── group1.tests │ │ ├── group2.right │ │ ├── group2.tests │ │ ├── groups_and_keywords1.right │ │ ├── groups_and_keywords1.tests │ │ ├── negate.right │ │ ├── negate.tests │ │ ├── noeol.right │ │ ├── noeol.tests │ │ ├── noeol2.right │ │ ├── noeol2.tests │ │ ├── noeol3.right │ │ ├── noeol3.tests │ │ ├── process_subst.right │ │ ├── process_subst.tests │ │ ├── quote1.right │ │ ├── quote1.tests │ │ ├── quote2.right │ │ ├── quote2.tests │ │ ├── quote3.right │ │ ├── quote3.tests │ │ ├── quote4.right │ │ ├── quote4.tests │ │ ├── redir_space.right │ │ ├── redir_space.tests │ │ ├── starquoted.right │ │ ├── starquoted.tests │ │ ├── starquoted2.right │ │ └── starquoted2.tests │ ├── hush-psubst │ │ ├── emptytick.right │ │ ├── emptytick.tests │ │ ├── falsetick.right │ │ ├── falsetick.tests │ │ ├── tick.right │ │ ├── tick.tests │ │ ├── tick2.right │ │ ├── tick2.tests │ │ ├── tick3.right │ │ ├── tick3.tests │ │ ├── tick4.right │ │ ├── tick4.tests │ │ ├── tick5.right │ │ ├── tick5.tests │ │ ├── tick_huge.right │ │ └── tick_huge.tests │ ├── hush-read │ │ ├── read_REPLY.right │ │ ├── read_REPLY.tests │ │ ├── read_ifs.right │ │ ├── read_ifs.tests │ │ ├── read_n.right │ │ ├── read_n.tests │ │ ├── read_r.right │ │ ├── read_r.tests │ │ ├── read_t.right │ │ └── read_t.tests │ ├── hush-trap │ │ ├── catch.right │ │ ├── catch.tests │ │ ├── exit.right │ │ ├── exit.tests │ │ ├── save-ret.right │ │ ├── save-ret.tests │ │ ├── savetrap.right │ │ ├── savetrap.tests │ │ ├── signal7.right │ │ ├── signal7.tests │ │ ├── signal_read1.right │ │ ├── signal_read1.tests │ │ ├── signal_read2.right │ │ ├── signal_read2.tests │ │ ├── subshell.right │ │ ├── subshell.tests │ │ ├── usage.right │ │ └── usage.tests │ ├── hush-vars │ │ ├── empty.right │ │ ├── empty.tests │ │ ├── glob_and_vars.right │ │ ├── glob_and_vars.tests │ │ ├── param_expand_alt.right │ │ ├── param_expand_alt.tests │ │ ├── param_expand_assign.right │ │ ├── param_expand_assign.tests │ │ ├── param_expand_bash_substring.right │ │ ├── param_expand_bash_substring.tests │ │ ├── param_expand_default.right │ │ ├── param_expand_default.tests │ │ ├── param_expand_indicate_error.right │ │ ├── param_expand_indicate_error.tests │ │ ├── param_expand_len.right │ │ ├── param_expand_len.tests │ │ ├── param_glob.right │ │ ├── param_glob.tests │ │ ├── param_subshell.right │ │ ├── param_subshell.tests │ │ ├── star.right │ │ ├── star.tests │ │ ├── unset.right │ │ ├── unset.tests │ │ ├── var1.right │ │ ├── var1.tests │ │ ├── var2.right │ │ ├── var2.tests │ │ ├── var3.right │ │ ├── var3.tests │ │ ├── var_bash1.right │ │ ├── var_bash1.tests │ │ ├── var_bash2.right │ │ ├── var_bash2.tests │ │ ├── var_bash3.right │ │ ├── var_bash3.tests │ │ ├── var_bash4.right │ │ ├── var_bash4.tests │ │ ├── var_bash5.right │ │ ├── var_bash5.tests │ │ ├── var_bash6.right │ │ ├── var_bash6.tests │ │ ├── var_expand_in_assign.right │ │ ├── var_expand_in_assign.tests │ │ ├── var_expand_in_redir.right │ │ ├── var_expand_in_redir.tests │ │ ├── var_expand_on_ifs.right │ │ ├── var_expand_on_ifs.tests │ │ ├── var_in_pipes.right │ │ ├── var_in_pipes.tests │ │ ├── var_leaks.right │ │ ├── var_leaks.tests │ │ ├── var_posix1.right │ │ ├── var_posix1.tests │ │ ├── var_preserved.right │ │ ├── var_preserved.tests │ │ ├── var_serial.right │ │ ├── var_serial.tests │ │ ├── var_subst_in_for.right │ │ ├── var_subst_in_for.tests │ │ ├── var_unbackslash.right │ │ └── var_unbackslash.tests │ ├── hush-z_slow │ │ ├── leak_all1.right │ │ ├── leak_all1.tests │ │ ├── leak_all2.right │ │ ├── leak_all2.tests │ │ ├── leak_empty_tick.right │ │ ├── leak_empty_tick.tests │ │ ├── leak_heredoc1.right │ │ ├── leak_heredoc1.tests │ │ ├── leak_var.right │ │ ├── leak_var.tests │ │ ├── leak_var2.right │ │ ├── leak_var2.tests │ │ ├── leak_var3.right │ │ └── leak_var3.tests │ └── run-all ├── match.c ├── match.h ├── math.c ├── math.h ├── msh_test │ ├── msh-bugs │ │ ├── noeol3.right │ │ ├── noeol3.tests │ │ ├── process_subst.right │ │ ├── process_subst.tests │ │ ├── read.right │ │ ├── read.tests │ │ ├── shift.right │ │ ├── shift.tests │ │ ├── starquoted.right │ │ ├── starquoted.tests │ │ ├── syntax_err.right │ │ ├── syntax_err.tests │ │ ├── var_expand_in_assign.right │ │ ├── var_expand_in_assign.tests │ │ ├── var_expand_in_redir.right │ │ └── var_expand_in_redir.tests │ ├── msh-execution │ │ ├── exitcode_EACCES.right │ │ ├── exitcode_EACCES.tests │ │ ├── exitcode_ENOENT.right │ │ ├── exitcode_ENOENT.tests │ │ ├── many_continues.right │ │ ├── many_continues.tests │ │ ├── nested_break.right │ │ └── nested_break.tests │ ├── msh-misc │ │ ├── tick.right │ │ └── tick.tests │ ├── msh-parsing │ │ ├── argv0.right │ │ ├── argv0.tests │ │ ├── noeol.right │ │ ├── noeol.tests │ │ ├── noeol2.right │ │ ├── noeol2.tests │ │ ├── quote1.right │ │ ├── quote1.tests │ │ ├── quote2.right │ │ ├── quote2.tests │ │ ├── quote3.right │ │ ├── quote3.tests │ │ ├── quote4.right │ │ └── quote4.tests │ ├── msh-vars │ │ ├── star.right │ │ ├── star.tests │ │ ├── var.right │ │ ├── var.tests │ │ ├── var_subst_in_for.right │ │ └── var_subst_in_for.tests │ └── run-all ├── random.c ├── random.h ├── shell_common.c └── shell_common.h ├── sysklogd ├── Config.src ├── Kbuild.src ├── klogd.c ├── logger.c ├── logread.c ├── syslogd.c └── syslogd_and_logger.c ├── testsuite ├── README ├── TODO ├── all_sourcecode.tests ├── ar.tests ├── ash.tests ├── awk.tests ├── awk_t1.tar.bz2 ├── basename │ ├── basename-does-not-remove-identical-extension │ └── basename-works ├── bunzip2.tests ├── bunzip2 │ ├── bunzip2-reads-from-standard-input │ ├── bunzip2-removes-compressed-file │ └── bzcat-does-not-remove-compressed-file ├── busybox.tests ├── bzcat.tests ├── cal.tests ├── cat │ ├── cat-prints-a-file │ └── cat-prints-a-file-and-standard-input ├── cmp │ └── cmp-detects-difference ├── comm.tests ├── cp.tests ├── cp │ ├── cp-RHL-does_not_preserve-links │ ├── cp-a-files-to-dir │ ├── cp-a-preserves-links │ ├── cp-copies-empty-file │ ├── cp-copies-large-file │ ├── cp-copies-small-file │ ├── cp-d-files-to-dir │ ├── cp-dev-file │ ├── cp-dir-create-dir │ ├── cp-dir-existing-dir │ ├── cp-does-not-copy-unreadable-file │ ├── cp-files-to-dir │ ├── cp-follows-links │ ├── cp-parents │ ├── cp-preserves-hard-links │ ├── cp-preserves-links │ └── cp-preserves-source-file ├── cpio.tests ├── cut.tests ├── cut │ ├── cut-cuts-a-character │ ├── cut-cuts-a-closed-range │ ├── cut-cuts-a-field │ ├── cut-cuts-an-open-range │ └── cut-cuts-an-unclosed-range ├── date │ ├── date-@-works │ ├── date-R-works │ ├── date-format-works │ ├── date-u-works │ ├── date-works │ └── date-works-1 ├── dd │ ├── dd-accepts-if │ ├── dd-accepts-of │ ├── dd-copies-from-standard-input-to-standard-output │ ├── dd-prints-count-to-standard-error │ └── dd-reports-write-errors ├── diff.tests ├── dirname │ ├── dirname-handles-absolute-path │ ├── dirname-handles-empty-path │ ├── dirname-handles-multiple-slashes │ ├── dirname-handles-relative-path │ ├── dirname-handles-root │ ├── dirname-handles-single-component │ └── dirname-works ├── du │ ├── du-h-works │ ├── du-k-works │ ├── du-l-works │ ├── du-m-works │ ├── du-s-works │ └── du-works ├── echo │ ├── echo-does-not-print-newline │ ├── echo-prints-argument │ ├── echo-prints-arguments │ ├── echo-prints-dash │ ├── echo-prints-newline │ ├── echo-prints-non-opts │ ├── echo-prints-slash-zero │ ├── echo-prints-slash_00041 │ ├── echo-prints-slash_0041 │ ├── echo-prints-slash_041 │ └── echo-prints-slash_41 ├── expand.tests ├── expand │ └── expand-works-like-GNU ├── expr │ ├── expr-big │ └── expr-works ├── false │ ├── false-is-silent │ └── false-returns-failure ├── find │ └── find-supports-minus-xdev ├── fold.tests ├── grep.tests ├── gunzip.tests ├── gunzip │ └── gunzip-reads-from-standard-input ├── gzip │ ├── gzip-accepts-multiple-files │ ├── gzip-accepts-single-minus │ └── gzip-removes-original-file ├── head │ ├── head-n-works │ └── head-works ├── hostid │ └── hostid-works ├── hostname │ ├── hostname-d-works │ ├── hostname-i-works │ ├── hostname-s-works │ └── hostname-works ├── id │ ├── id-g-works │ ├── id-u-works │ ├── id-un-works │ └── id-ur-works ├── ln │ ├── ln-creates-hard-links │ ├── ln-creates-soft-links │ ├── ln-force-creates-hard-links │ ├── ln-force-creates-soft-links │ ├── ln-preserves-hard-links │ └── ln-preserves-soft-links ├── ls.mk_uni_tests ├── ls.tests ├── ls │ ├── ls-1-works │ ├── ls-h-works │ ├── ls-l-works │ └── ls-s-works ├── makedevs.device_table.txt ├── makedevs.tests ├── md5sum.tests ├── md5sum │ └── md5sum-verifies-non-binary-file ├── mdev.tests ├── mkdir │ ├── mkdir-makes-a-directory │ └── mkdir-makes-parent-directories ├── mkfs.minix.tests ├── mount.testroot ├── mount.tests ├── msh │ └── msh-supports-underscores-in-variable-names ├── mv │ ├── mv-files-to-dir │ ├── mv-follows-links │ ├── mv-moves-empty-file │ ├── mv-moves-file │ ├── mv-moves-hardlinks │ ├── mv-moves-large-file │ ├── mv-moves-small-file │ ├── mv-moves-symlinks │ ├── mv-moves-unreadable-files │ ├── mv-preserves-hard-links │ ├── mv-preserves-links │ ├── mv-refuses-mv-dir-to-subdir │ └── mv-removes-source-file ├── od.tests ├── parse.tests ├── patch.tests ├── pidof.tests ├── printf.tests ├── pwd │ └── pwd-prints-working-directory ├── readlink.tests ├── rm │ └── rm-removes-file ├── rmdir │ └── rmdir-removes-parent-directories ├── runtest ├── rx.tests ├── sed.tests ├── seq.tests ├── sha1sum.tests ├── sha256sum.tests ├── sha3sum.tests ├── sha512sum.tests ├── sort.tests ├── start-stop-daemon.tests ├── strings │ └── strings-works-like-GNU ├── sum.tests ├── tail.tests ├── tail │ ├── tail-n-works │ └── tail-works ├── tar.tests ├── tar │ ├── tar-archives-multiple-files │ ├── tar-complains-about-missing-file │ ├── tar-demands-at-least-one-ctx │ ├── tar-demands-at-most-one-ctx │ ├── tar-extracts-all-subdirs │ ├── tar-extracts-file │ ├── tar-extracts-from-standard-input │ ├── tar-extracts-multiple-files │ ├── tar-extracts-to-standard-output │ ├── tar-handles-cz-options │ ├── tar-handles-empty-include-and-non-empty-exclude-list │ ├── tar-handles-exclude-and-extract-lists │ ├── tar-handles-multiple-X-options │ ├── tar-handles-nested-exclude │ ├── tar_with_link_with_size │ └── tar_with_prefix_fields ├── taskset.tests ├── tee │ ├── tee-appends-input │ └── tee-tees-input ├── test.tests ├── testing.sh ├── touch │ ├── touch-creates-file │ ├── touch-does-not-create-file │ └── touch-touches-files-after-non-existent-file ├── tr.tests ├── tr │ ├── tr-d-alnum-works │ ├── tr-d-works │ ├── tr-non-gnu │ ├── tr-rejects-wrong-class │ └── tr-works ├── true │ ├── true-is-silent │ └── true-returns-success ├── umlwrapper.sh ├── uncompress.tests ├── unexpand.tests ├── unexpand │ └── unexpand-works-like-GNU ├── uniq.tests ├── unzip.tests ├── uptime │ └── uptime-works ├── uuencode.tests ├── wc │ ├── wc-counts-all │ ├── wc-counts-characters │ ├── wc-counts-lines │ ├── wc-counts-words │ └── wc-prints-longest-line-length ├── wget │ ├── wget--O-overrides--P │ ├── wget-handles-empty-path │ ├── wget-retrieves-google-index │ └── wget-supports--P ├── which │ └── which-uses-default-path ├── xargs.tests └── xargs │ └── xargs-works └── util-linux ├── Config.src ├── Kbuild.src ├── acpid.c ├── blkid.c ├── blockdev.c ├── dmesg.c ├── fbset.c ├── fdformat.c ├── fdisk.c ├── fdisk_aix.c ├── fdisk_gpt.c ├── fdisk_osf.c ├── fdisk_sgi.c ├── fdisk_sun.c ├── findfs.c ├── flock.c ├── freeramdisk.c ├── fsck_minix.c ├── fstrim.c ├── getopt.c ├── hexdump.c ├── hwclock.c ├── ipcrm.c ├── ipcs.c ├── losetup.c ├── lspci.c ├── lsusb.c ├── mdev.c ├── minix.h ├── mkfs_ext2.c ├── mkfs_ext2.txt ├── mkfs_ext2_test.sh ├── mkfs_minix.c ├── mkfs_reiser.c ├── mkfs_vfat.c ├── mkswap.c ├── more.c ├── mount.c ├── pivot_root.c ├── rdate.c ├── rdev.c ├── readprofile.c ├── rev.c ├── rtcwake.c ├── script.c ├── scriptreplay.c ├── setarch.c ├── swaponoff.c ├── switch_root.c ├── umount.c └── volume_id ├── Config.src ├── Kbuild.src ├── btrfs.c ├── cramfs.c ├── exfat.c ├── ext.c ├── f2fs.c ├── fat.c ├── get_devname.c ├── hfs.c ├── iso9660.c ├── jfs.c ├── linux_raid.c ├── linux_swap.c ├── luks.c ├── nilfs.c ├── ntfs.c ├── ocfs2.c ├── reiserfs.c ├── romfs.c ├── squashfs.c ├── sysv.c ├── udf.c ├── unused_highpoint.c ├── unused_hpfs.c ├── unused_isw_raid.c ├── unused_lsi_raid.c ├── unused_lvm.c ├── unused_mac.c ├── unused_minix.c ├── unused_msdos.c ├── unused_nvidia_raid.c ├── unused_promise_raid.c ├── unused_silicon_raid.c ├── unused_ufs.c ├── unused_via_raid.c ├── util.c ├── volume_id.c ├── volume_id_internal.h └── xfs.c /.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # Kbuild ignores 3 | # 4 | .* 5 | *.o 6 | *.o.* 7 | *.a 8 | *.s 9 | Kbuild 10 | Config.in 11 | 12 | # 13 | # Never ignore these 14 | # 15 | !.gitignore 16 | !.config* 17 | 18 | # 19 | # Normal output 20 | # 21 | /busybox 22 | /busybox_old 23 | /busybox_unstripped* 24 | /include-xposed/ 25 | 26 | # 27 | # Backups / patches 28 | # 29 | *~ 30 | *.orig 31 | *.rej 32 | /*.patch 33 | /.config.old 34 | 35 | # 36 | # debugging stuff 37 | # 38 | core 39 | .gdb_history 40 | .gdbinit 41 | -------------------------------------------------------------------------------- /android/libc/arch-arm/syscalls/swapoff.S: -------------------------------------------------------------------------------- 1 | /* autogenerated by gensyscalls.py */ 2 | #include 3 | 4 | .text 5 | .type swapoff, #function 6 | .globl swapoff 7 | .align 4 8 | .fnstart 9 | 10 | swapoff: 11 | .save {r4, r7} 12 | stmfd sp!, {r4, r7} 13 | ldr r7, =__NR_swapoff 14 | swi #0 15 | ldmfd sp!, {r4, r7} 16 | movs r0, r0 17 | bxpl lr 18 | b __set_errno 19 | .fnend 20 | -------------------------------------------------------------------------------- /android/libc/arch-arm/syscalls/swapon.S: -------------------------------------------------------------------------------- 1 | /* autogenerated by gensyscalls.py */ 2 | #include 3 | 4 | .text 5 | .type swapon, #function 6 | .globl swapon 7 | .align 4 8 | .fnstart 9 | 10 | swapon: 11 | .save {r4, r7} 12 | stmfd sp!, {r4, r7} 13 | ldr r7, =__NR_swapon 14 | swi #0 15 | ldmfd sp!, {r4, r7} 16 | movs r0, r0 17 | bxpl lr 18 | b __set_errno 19 | .fnend 20 | -------------------------------------------------------------------------------- /android/libc/arch-arm/syscalls/sysinfo.S: -------------------------------------------------------------------------------- 1 | /* autogenerated by gensyscalls.py */ 2 | #include 3 | 4 | .text 5 | .type sysinfo, #function 6 | .globl sysinfo 7 | .align 4 8 | .fnstart 9 | 10 | sysinfo: 11 | .save {r4, r7} 12 | stmfd sp!, {r4, r7} 13 | ldr r7, =__NR_sysinfo 14 | swi #0 15 | ldmfd sp!, {r4, r7} 16 | movs r0, r0 17 | bxpl lr 18 | b __set_errno 19 | .fnend 20 | -------------------------------------------------------------------------------- /android/libc/arch-mips/syscalls/swapoff.S: -------------------------------------------------------------------------------- 1 | /* autogenerated by gensyscalls.py */ 2 | #include 3 | .text 4 | .globl swapoff 5 | .align 4 6 | .ent swapoff 7 | 8 | swapoff: 9 | .set noreorder 10 | .cpload $t9 11 | li $v0, (4000+115) 12 | syscall 13 | bnez $a3, 1f 14 | move $a0, $v0 15 | j $ra 16 | nop 17 | 1: 18 | la $t9,__set_errno 19 | j $t9 20 | nop 21 | .set reorder 22 | .end swapoff 23 | -------------------------------------------------------------------------------- /android/libc/arch-mips/syscalls/swapon.S: -------------------------------------------------------------------------------- 1 | /* autogenerated by gensyscalls.py */ 2 | #include 3 | .text 4 | .globl swapon 5 | .align 4 6 | .ent swapon 7 | 8 | swapon: 9 | .set noreorder 10 | .cpload $t9 11 | li $v0, (4000+87) 12 | syscall 13 | bnez $a3, 1f 14 | move $a0, $v0 15 | j $ra 16 | nop 17 | 1: 18 | la $t9,__set_errno 19 | j $t9 20 | nop 21 | .set reorder 22 | .end swapon 23 | -------------------------------------------------------------------------------- /android/libc/arch-mips/syscalls/sysinfo.S: -------------------------------------------------------------------------------- 1 | /* autogenerated by gensyscalls.py */ 2 | #include 3 | .text 4 | .globl sysinfo 5 | .align 4 6 | .ent sysinfo 7 | 8 | sysinfo: 9 | .set noreorder 10 | .cpload $t9 11 | li $v0, (4000+116) 12 | syscall 13 | bnez $a3, 1f 14 | move $a0, $v0 15 | j $ra 16 | nop 17 | 1: 18 | la $t9,__set_errno 19 | j $t9 20 | nop 21 | .set reorder 22 | .end sysinfo 23 | -------------------------------------------------------------------------------- /android/librpc/libintl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rovo89/android_external_busybox/bfc653df950d818681510d6004124621bc30240d/android/librpc/libintl.h -------------------------------------------------------------------------------- /android/librpc/svc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rovo89/android_external_busybox/bfc653df950d818681510d6004124621bc30240d/android/librpc/svc.c -------------------------------------------------------------------------------- /applets/.gitignore: -------------------------------------------------------------------------------- 1 | /applet_tables 2 | /usage 3 | /usage_pod 4 | -------------------------------------------------------------------------------- /applets/applets.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Stub for linking busybox binary against libbusybox. 4 | * 5 | * Copyright (C) 2007 Denys Vlasenko 6 | * 7 | * Licensed under GPLv2, see file LICENSE in this source tree. 8 | */ 9 | #if ENABLE_BUILD_LIBBUSYBOX 10 | #include "busybox.h" 11 | int main(int argc UNUSED_PARAM, char **argv) 12 | { 13 | return lbb_main(argv); 14 | } 15 | #endif 16 | -------------------------------------------------------------------------------- /applets_sh/README: -------------------------------------------------------------------------------- 1 | This directory contains examples of applets implemented as shell scripts. 2 | 3 | So far these scripts are not hooked to the build system and are not 4 | installed by "make install". If you want to use them, 5 | you need to install them by hand. 6 | -------------------------------------------------------------------------------- /applets_sh/dos2unix: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # TODO: use getopt to avoid parsing options as filenames, 3 | # and to support -- and --help 4 | [ $# -ne 0 ] && DASH_I=-i 5 | sed $DASH_I -e 's/\r$//' "$@" 6 | -------------------------------------------------------------------------------- /applets_sh/nologin: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cat /etc/nologin.txt 2>/dev/null || echo "This account is not available" 3 | sleep 5 4 | exit 1 5 | -------------------------------------------------------------------------------- /applets_sh/tac: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # TODO: use getopt to avoid parsing options as filenames, 3 | # and to support -- and --help 4 | for i in "$@" 5 | do 6 | sed -e '1!G;h;$!d' "$i" 7 | done 8 | -------------------------------------------------------------------------------- /applets_sh/unix2dos: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # TODO: use getopt to avoid parsing options as filenames, 3 | # and to support -- and --help 4 | [ $# -ne 0 ] && DASH_I=-i 5 | sed $DASH_I -e 's/$/\r/' "$@" 6 | -------------------------------------------------------------------------------- /arch/i386/Makefile: -------------------------------------------------------------------------------- 1 | # ========================================================================== 2 | # Build system 3 | # ========================================================================== 4 | 5 | # -mpreferred-stack-boundary=2 is essential in preventing gcc 4.2.x 6 | # from aligning stack to 16 bytes. (Which is gcc's way of supporting SSE). 7 | CFLAGS += $(call cc-option,-march=i386 -mpreferred-stack-boundary=2,) 8 | -------------------------------------------------------------------------------- /archival/Kbuild.src: -------------------------------------------------------------------------------- 1 | # Makefile for busybox 2 | # 3 | # Copyright (C) 1999-2005 by Erik Andersen 4 | # 5 | # Licensed under GPLv2, see file LICENSE in this source tree. 6 | 7 | libs-y += libarchive/ 8 | 9 | lib-y:= 10 | 11 | INSERT 12 | -------------------------------------------------------------------------------- /archival/bbunzip_test2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Leak test for gunzip. Watch top for growing process size. 3 | 4 | # Just using urandom will make gzip use method 0 (store) - 5 | # not good for test coverage! 6 | 7 | cat /dev/urandom \ 8 | | while true; do read junk; echo "junk $RANDOM $junk"; done \ 9 | | ../busybox gzip \ 10 | | ../busybox gunzip -c >/dev/null 11 | -------------------------------------------------------------------------------- /archival/libarchive/data_align.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 4 | */ 5 | 6 | #include "libbb.h" 7 | #include "bb_archive.h" 8 | 9 | void FAST_FUNC data_align(archive_handle_t *archive_handle, unsigned boundary) 10 | { 11 | unsigned skip_amount = (boundary - (archive_handle->offset % boundary)) % boundary; 12 | 13 | archive_handle->seek(archive_handle->src_fd, skip_amount); 14 | archive_handle->offset += skip_amount; 15 | } 16 | -------------------------------------------------------------------------------- /archival/libarchive/data_extract_to_stdout.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 4 | */ 5 | 6 | #include "libbb.h" 7 | #include "bb_archive.h" 8 | 9 | void FAST_FUNC data_extract_to_stdout(archive_handle_t *archive_handle) 10 | { 11 | bb_copyfd_exact_size(archive_handle->src_fd, 12 | STDOUT_FILENO, 13 | archive_handle->file_header->size); 14 | } 15 | -------------------------------------------------------------------------------- /archival/libarchive/data_skip.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 4 | */ 5 | 6 | #include "libbb.h" 7 | #include "bb_archive.h" 8 | 9 | void FAST_FUNC data_skip(archive_handle_t *archive_handle) 10 | { 11 | archive_handle->seek(archive_handle->src_fd, archive_handle->file_header->size); 12 | } 13 | -------------------------------------------------------------------------------- /archival/libarchive/filter_accept_all.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Copyright (C) 2002 by Glenn McGrath 4 | * 5 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 6 | */ 7 | 8 | #include "libbb.h" 9 | #include "bb_archive.h" 10 | 11 | /* Accept any non-null name, its not really a filter at all */ 12 | char FAST_FUNC filter_accept_all(archive_handle_t *archive_handle) 13 | { 14 | if (archive_handle->file_header->name) 15 | return EXIT_SUCCESS; 16 | return EXIT_FAILURE; 17 | } 18 | -------------------------------------------------------------------------------- /archival/libarchive/header_list.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 4 | */ 5 | #include "libbb.h" 6 | #include "bb_archive.h" 7 | 8 | void FAST_FUNC header_list(const file_header_t *file_header) 9 | { 10 | //TODO: cpio -vp DIR should output "DIR/NAME", not just "NAME" */ 11 | puts(file_header->name); 12 | } 13 | -------------------------------------------------------------------------------- /archival/libarchive/header_skip.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 4 | */ 5 | #include "libbb.h" 6 | #include "bb_archive.h" 7 | 8 | void FAST_FUNC header_skip(const file_header_t *file_header UNUSED_PARAM) 9 | { 10 | } 11 | -------------------------------------------------------------------------------- /archival/libarchive/seek_by_jump.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 4 | */ 5 | 6 | #include "libbb.h" 7 | #include "bb_archive.h" 8 | 9 | void FAST_FUNC seek_by_jump(int fd, off_t amount) 10 | { 11 | if (amount 12 | && lseek(fd, amount, SEEK_CUR) == (off_t) -1 13 | ) { 14 | if (errno == ESPIPE) 15 | seek_by_read(fd, amount); 16 | else 17 | bb_perror_msg_and_die("seek failure"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /archival/libarchive/seek_by_read.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 4 | */ 5 | 6 | #include "libbb.h" 7 | #include "bb_archive.h" 8 | 9 | /* If we are reading through a pipe, or from stdin then we can't lseek, 10 | * we must read and discard the data to skip over it. 11 | */ 12 | void FAST_FUNC seek_by_read(int fd, off_t amount) 13 | { 14 | if (amount) 15 | bb_copyfd_exact_size(fd, -1, amount); 16 | } 17 | -------------------------------------------------------------------------------- /busybox-xposed.links: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rovo89/android_external_busybox/bfc653df950d818681510d6004124621bc30240d/busybox-xposed.links -------------------------------------------------------------------------------- /coreutils/libcoreutils/Kbuild.src: -------------------------------------------------------------------------------- 1 | # Makefile for busybox 2 | # 3 | # Copyright (C) 1999-2004 by Erik Andersen 4 | # 5 | # Licensed under GPLv2 or later, see file LICENSE in this source tree. 6 | 7 | lib-y:= 8 | 9 | INSERT 10 | lib-$(CONFIG_MKFIFO) += getopt_mk_fifo_nod.o 11 | lib-$(CONFIG_MKNOD) += getopt_mk_fifo_nod.o 12 | lib-$(CONFIG_INSTALL) += cp_mv_stat.o 13 | lib-$(CONFIG_CP) += cp_mv_stat.o 14 | lib-$(CONFIG_MV) += cp_mv_stat.o 15 | -------------------------------------------------------------------------------- /debianutils/Kbuild.src: -------------------------------------------------------------------------------- 1 | # Makefile for busybox 2 | # 3 | # Copyright (C) 1999-2005 by Erik Andersen 4 | # 5 | # Licensed under GPLv2, see file LICENSE in this source tree. 6 | 7 | lib-y:= 8 | 9 | INSERT 10 | lib-$(CONFIG_MKTEMP) += mktemp.o 11 | lib-$(CONFIG_PIPE_PROGRESS) += pipe_progress.o 12 | lib-$(CONFIG_RUN_PARTS) += run_parts.o 13 | lib-$(CONFIG_START_STOP_DAEMON) += start_stop_daemon.o 14 | lib-$(CONFIG_WHICH) += which.o 15 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | /busybox.1 2 | /BusyBox.html 3 | /busybox.net 4 | /BusyBox.txt 5 | /busybox.pod 6 | -------------------------------------------------------------------------------- /docs/unicode_UTF-8-test.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rovo89/android_external_busybox/bfc653df950d818681510d6004124621bc30240d/docs/unicode_UTF-8-test.txt -------------------------------------------------------------------------------- /docs/unicode_full-bmp.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rovo89/android_external_busybox/bfc653df950d818681510d6004124621bc30240d/docs/unicode_full-bmp.txt -------------------------------------------------------------------------------- /e2fsprogs/Kbuild.src: -------------------------------------------------------------------------------- 1 | # Makefile for busybox 2 | # 3 | # Copyright (C) 1999-2005 by Erik Andersen 4 | # 5 | # Licensed under GPLv2, see file LICENSE in this source tree. 6 | 7 | lib-y:= 8 | 9 | INSERT 10 | 11 | lib-$(CONFIG_CHATTR) += chattr.o e2fs_lib.o 12 | lib-$(CONFIG_LSATTR) += lsattr.o e2fs_lib.o 13 | 14 | lib-$(CONFIG_FSCK) += fsck.o 15 | lib-$(CONFIG_TUNE2FS) += tune2fs.o 16 | -------------------------------------------------------------------------------- /e2fsprogs/README: -------------------------------------------------------------------------------- 1 | Authors and contributors of original e2fsprogs: 2 | 3 | Remy Card 4 | Theodore Ts'o 5 | Stephen C. Tweedie 6 | Andreas Gruenbacher, 7 | Kaz Kylheku 8 | F.W. ten Wolde 9 | Jeremy Fitzhardinge 10 | M.J.E. Mol 11 | Miquel van Smoorenburg 12 | Uwe Ohse 13 | -------------------------------------------------------------------------------- /e2fsprogs/old_e2fsprogs/README: -------------------------------------------------------------------------------- 1 | This is a pretty straight rip from the e2fsprogs pkg. 2 | 3 | See README's in subdirs for specific info. 4 | -------------------------------------------------------------------------------- /e2fsprogs/old_e2fsprogs/ext2fs/ext2_types.h: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | #include 3 | -------------------------------------------------------------------------------- /e2fsprogs/old_e2fsprogs/fsck.h: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * fsck.h 4 | */ 5 | 6 | #define FSCK_ATTR(x) __attribute__(x) 7 | 8 | #define EXIT_OK 0 9 | #define EXIT_NONDESTRUCT 1 10 | #define EXIT_DESTRUCT 2 11 | #define EXIT_UNCORRECTED 4 12 | #define EXIT_ERROR 8 13 | #define EXIT_USAGE 16 14 | #define FSCK_CANCELED 32 /* Aborted with a signal or ^C */ 15 | 16 | extern char *e2fs_set_sbin_path(void); 17 | -------------------------------------------------------------------------------- /e2fsprogs/old_e2fsprogs/uuid/Kbuild.src: -------------------------------------------------------------------------------- 1 | # Makefile for busybox 2 | # 3 | # Copyright (C) 1999-2005 by Erik Andersen 4 | # 5 | # Licensed under GPLv2, see file LICENSE in this source tree. 6 | 7 | NEEDED-$(CONFIG_E2FSCK) = y 8 | NEEDED-$(CONFIG_FSCK) = y 9 | NEEDED-$(CONFIG_MKE2FS) = y 10 | NEEDED-$(CONFIG_TUNE2FS) = y 11 | 12 | lib-y:= 13 | 14 | INSERT 15 | lib-$(NEEDED-y) += compare.o gen_uuid.o pack.o parse.o unpack.o unparse.o \ 16 | uuid_time.o 17 | -------------------------------------------------------------------------------- /editors/Config.src: -------------------------------------------------------------------------------- 1 | # 2 | # For a description of the syntax of this configuration file, 3 | # see scripts/kbuild/config-language.txt. 4 | # 5 | 6 | menu "Editors" 7 | 8 | INSERT 9 | 10 | config FEATURE_ALLOW_EXEC 11 | bool "Allow vi and awk to execute shell commands" 12 | default y 13 | depends on VI || AWK 14 | help 15 | Enables vi and awk features which allows user to execute 16 | shell commands (using system() C call). 17 | 18 | endmenu 19 | -------------------------------------------------------------------------------- /editors/Kbuild.src: -------------------------------------------------------------------------------- 1 | # Makefile for busybox 2 | # 3 | # Copyright (C) 1999-2005 by Erik Andersen 4 | # 5 | # Licensed under GPLv2, see file LICENSE in this source tree. 6 | 7 | lib-y:= 8 | 9 | INSERT 10 | -------------------------------------------------------------------------------- /examples/bootfloppy/display.txt: -------------------------------------------------------------------------------- 1 | 2 | This boot floppy is made with Busybox, uClibc, and the Linux kernel. 3 | Hit RETURN to boot or enter boot parameters at the prompt below. 4 | -------------------------------------------------------------------------------- /examples/bootfloppy/etc/fstab: -------------------------------------------------------------------------------- 1 | proc /proc proc defaults 0 0 2 | -------------------------------------------------------------------------------- /examples/bootfloppy/etc/init.d/rcS: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | /bin/mount -a 4 | -------------------------------------------------------------------------------- /examples/bootfloppy/etc/inittab: -------------------------------------------------------------------------------- 1 | ::sysinit:/etc/init.d/rcS 2 | ::respawn:-/bin/sh 3 | tty2::askfirst:-/bin/sh 4 | ::ctrlaltdel:/bin/umount -a -r 5 | -------------------------------------------------------------------------------- /examples/bootfloppy/etc/profile: -------------------------------------------------------------------------------- 1 | # /etc/profile: system-wide .profile file for the Bourne shells 2 | 3 | echo 4 | echo -n "Processing /etc/profile... " 5 | # no-op 6 | echo "Done" 7 | echo 8 | -------------------------------------------------------------------------------- /examples/bootfloppy/syslinux.cfg: -------------------------------------------------------------------------------- 1 | display display.txt 2 | default linux 3 | timeout 10 4 | prompt 1 5 | label linux 6 | kernel linux 7 | append initrd=rootfs.gz root=/dev/ram0 8 | -------------------------------------------------------------------------------- /examples/dnsd.conf: -------------------------------------------------------------------------------- 1 | thebox 192.168.1.5 2 | -------------------------------------------------------------------------------- /examples/udhcp/sample.deconfig: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Sample udhcpc deconfig script 3 | 4 | /sbin/ifconfig $interface 0.0.0.0 5 | -------------------------------------------------------------------------------- /examples/udhcp/sample.nak: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Sample udhcpc nak script 3 | 4 | echo Received a NAK: $message 5 | -------------------------------------------------------------------------------- /examples/udhcp/sample.script: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Currently, we only dispatch according to command. However, a more 3 | # elaborate system might dispatch by command and interface or do some 4 | # common initialization first, especially if more dhcp event notifications 5 | # are added. 6 | 7 | exec /usr/share/udhcpc/sample.$1 8 | -------------------------------------------------------------------------------- /examples/var_service/dhcp_if/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | user=logger 4 | 5 | logdir="/var/log/service/`(cd ..;basename $PWD)`" 6 | mkdir -p "$logdir" 2>/dev/null 7 | chown -R "$user": "$logdir" 8 | chmod -R go-rwxst,u+rwX "$logdir" 9 | rm logdir 10 | ln -s "$logdir" logdir 11 | 12 | # make this dir accessible to logger 13 | chmod a+rX . 14 | 15 | exec >/dev/null 16 | exec 2>&1 17 | exec \ 18 | env - PATH="$PATH" \ 19 | softlimit \ 20 | setuidgid "$user" \ 21 | svlogd -tt "$logdir" 22 | -------------------------------------------------------------------------------- /examples/var_service/dhcp_if/p_log: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd log/logdir || exit 1 4 | cat @* current | $PAGER 5 | -------------------------------------------------------------------------------- /examples/var_service/dhcp_if/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec 2>&1 4 | exec &1 | cut -b1-$((w-2))' 5 | -------------------------------------------------------------------------------- /examples/var_service/ftpd/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | user=logger 4 | 5 | logdir="/var/log/service/`(cd ..;basename $PWD)`" 6 | mkdir -p "$logdir" 2>/dev/null 7 | chown -R "$user": "$logdir" 8 | chmod -R go-rwxst,u+rwX "$logdir" 9 | rm logdir 10 | ln -s "$logdir" logdir 11 | 12 | # make this dir accessible to logger 13 | chmod a+rX . 14 | 15 | exec >/dev/null 16 | exec 2>&1 17 | exec \ 18 | env - PATH="$PATH" \ 19 | softlimit \ 20 | setuidgid "$user" \ 21 | svlogd -tt "$logdir" 22 | -------------------------------------------------------------------------------- /examples/var_service/ftpd/p_log: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd log/logdir || exit 1 4 | cat @* current | $PAGER 5 | -------------------------------------------------------------------------------- /examples/var_service/ftpd/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #exec >/dev/null 4 | exec 2>&1 5 | exec &1 | cut -b1-$((w-2))' 5 | -------------------------------------------------------------------------------- /examples/var_service/fw/conf/11.22.33.44.ipconf--: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # If we have simple static address... 3 | # 4 | let cfg=cfg+1 5 | if[$cfg]=if 6 | ip[$cfg]=11.22.33.44 7 | ipmask[$cfg]=11.22.33.44/24 8 | gw[$cfg]=11.22.33.1 9 | net[$cfg]=0/0 10 | dns[$cfg]='11.22.33.2 11.22.33.3' 11 | -------------------------------------------------------------------------------- /examples/var_service/fw/conf/192.168.0.1.ipconf: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # A small network with no routers 3 | # (maybe *we* are their router) 4 | # 5 | let cfg=cfg+1 6 | if[$cfg]=if 7 | ip[$cfg]=192.168.0.1 8 | ipmask[$cfg]=192.168.0.1/24 9 | ### gw[$cfg]= 10 | ### net[$cfg]=0/0 11 | ### dns[$cfg]='' 12 | -------------------------------------------------------------------------------- /examples/var_service/fw/conf/lo.ipconf: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Mostly redundant except when you need dns[]=your_static_dns_srv 3 | # 4 | let cfg=cfg+1 5 | if[$cfg]=lo 6 | ip[$cfg]=127.0.0.1 7 | ipmask[$cfg]=127.0.0.1/8 8 | gw[$cfg]='' 9 | net[$cfg]='' 10 | #dns[$cfg]=127.0.0.1 11 | -------------------------------------------------------------------------------- /examples/var_service/fw/stat: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo; echo "* Firewall:" 4 | { 5 | echo '---FILTER--'; 6 | iptables -v -L -x -n; 7 | echo '---NAT-----'; 8 | iptables -t nat -v -L -x -n; 9 | echo '---MANGLE--'; 10 | iptables -t mangle -v -L -x -n; 11 | } \ 12 | | grep -v '^$' | grep -Fv 'bytes target' | $PAGER 13 | -------------------------------------------------------------------------------- /examples/var_service/getty_tty1/alt08x16+unimap.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rovo89/android_external_busybox/bfc653df950d818681510d6004124621bc30240d/examples/var_service/getty_tty1/alt08x16+unimap.fnt -------------------------------------------------------------------------------- /examples/var_service/getty_tty1/login.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ttyname=`tty` 4 | ttybase="${ttyname%%[0123456789]*}" # strip numeric tail 5 | 6 | if test "$ttybase" = "/dev/tty"; then 7 | tail="${ttyname:8}" 8 | echo "* Setting terminal device's owner to $LOGIN_UID:$LOGIN_GID" 9 | chown "$LOGIN_UID:$LOGIN_GID" "/dev/vcs$tail" "/dev/vcsa$tail" 10 | fi 11 | # We can do this also, but login does it itself 12 | # chown "$LOGIN_UID:$LOGIN_GID" "$ttyname" 13 | -------------------------------------------------------------------------------- /examples/var_service/gpm/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec >/dev/null 4 | exec 2>&1 5 | exec /dev/null 7 | chown -R "$user": "$logdir" 8 | chmod -R go-rwxst,u+rwX "$logdir" 9 | rm logdir 10 | ln -s "$logdir" logdir 11 | 12 | # make this dir accessible to logger 13 | chmod a+rX . 14 | 15 | exec >/dev/null 16 | exec 2>&1 17 | exec \ 18 | env - PATH="$PATH" \ 19 | softlimit \ 20 | setuidgid "$user" \ 21 | svlogd -tt "$logdir" 22 | -------------------------------------------------------------------------------- /examples/var_service/httpd/p_log: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd log/logdir || exit 1 4 | cat @* current | $PAGER 5 | -------------------------------------------------------------------------------- /examples/var_service/httpd/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #exec >/dev/null 4 | exec 2>&1 5 | exec &1 | cut -b1-$((w-2))' 5 | -------------------------------------------------------------------------------- /examples/var_service/ifplugd_if/ifplugd_handler: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # parameters: 3 | # $1: interface 4 | # $2: state 5 | 6 | if test -d "/var/service/dhcp_$1"; then 7 | if test x"$2" = x"down"; then 8 | echo "Downing /var/service/dhcp_$1" 9 | sv d "/var/service/dhcp_$1" 10 | fi 11 | if test x"$2" = x"up"; then 12 | echo "Upping /var/service/dhcp_$1" 13 | sv u "/var/service/dhcp_$1" 14 | fi 15 | fi 16 | -------------------------------------------------------------------------------- /examples/var_service/ifplugd_if/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | user=logger 4 | 5 | logdir="/var/log/service/`(cd ..;basename $PWD)`" 6 | mkdir -p "$logdir" 2>/dev/null 7 | chown -R "$user": "$logdir" 8 | chmod -R go-rwxst,u+rwX "$logdir" 9 | rm logdir 10 | ln -s "$logdir" logdir 11 | 12 | # make this dir accessible to logger 13 | chmod a+rX . 14 | 15 | exec >/dev/null 16 | exec 2>&1 17 | exec \ 18 | env - PATH="$PATH" \ 19 | softlimit \ 20 | setuidgid "$user" \ 21 | svlogd -tt "$logdir" 22 | -------------------------------------------------------------------------------- /examples/var_service/ifplugd_if/p_log: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd log/logdir || exit 1 4 | cat @* current | $PAGER 5 | -------------------------------------------------------------------------------- /examples/var_service/ifplugd_if/w_log: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd log/logdir || exit 1 4 | watch -n2 'w=`ttysize w`; h=`ttysize h`; tail -$((h-3)) current 2>&1 | cut -b1-$((w-2))' 5 | -------------------------------------------------------------------------------- /examples/var_service/inetd/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | user=logger 4 | 5 | logdir="/var/log/service/`(cd ..;basename $PWD)`" 6 | mkdir -p "$logdir" 2>/dev/null 7 | chown -R "$user": "$logdir" 8 | chmod -R go-rwxst,u+rwX "$logdir" 9 | rm logdir 10 | ln -s "$logdir" logdir 11 | 12 | # make this dir accessible to logger 13 | chmod a+rX . 14 | 15 | exec >/dev/null 16 | exec 2>&1 17 | exec \ 18 | env - PATH="$PATH" \ 19 | softlimit \ 20 | setuidgid "$user" \ 21 | svlogd -tt "$logdir" 22 | -------------------------------------------------------------------------------- /examples/var_service/inetd/p_log: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd log/logdir || exit 1 4 | cat @* current | $PAGER 5 | -------------------------------------------------------------------------------- /examples/var_service/inetd/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #exec >/dev/null 4 | exec 2>&1 5 | exec &1 | cut -b1-$((w-2))' 5 | -------------------------------------------------------------------------------- /examples/var_service/nmeter/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec >/dev/null 4 | exec 2>&1 5 | exec /proc/self/net/) appeared, 8 | # we need to be root 9 | user="root" 10 | tty="/dev/tty9" 11 | cmd="nmeter '%t %c x %x p%p f %f b %b m %m if%[nif]'" 12 | 13 | chmod -R a+X . # or else env will moan 14 | chown "$user": "$tty" # devfs made happy 15 | 16 | eval exec \ 17 | env - PATH="$PATH" \ 18 | setuidgid "$user" \ 19 | <"$tty" >"$tty" 2>&1 \ 20 | $cmd 21 | -------------------------------------------------------------------------------- /examples/var_service/ntpd/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | user=logger 4 | 5 | logdir="/var/log/service/`(cd ..;basename $PWD)`" 6 | mkdir -p "$logdir" 2>/dev/null 7 | chown -R "$user": "$logdir" 8 | chmod -R go-rwxst,u+rwX "$logdir" 9 | rm logdir 10 | ln -s "$logdir" logdir 11 | 12 | # make this dir accessible to logger 13 | chmod a+rX . 14 | 15 | exec >/dev/null 16 | exec 2>&1 17 | exec \ 18 | env - PATH="$PATH" \ 19 | softlimit \ 20 | setuidgid "$user" \ 21 | svlogd -tt "$logdir" 22 | -------------------------------------------------------------------------------- /examples/var_service/ntpd/p_log: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd log/logdir || exit 1 4 | cat @* current | $PAGER 5 | -------------------------------------------------------------------------------- /examples/var_service/ntpd/w_log: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd log/logdir || exit 1 4 | watch -n2 'w=`ttysize w`; h=`ttysize h`; tail -$((h-3)) current 2>&1 | cut -b1-$((w-2))' 5 | -------------------------------------------------------------------------------- /examples/var_service/tftpd/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | user=logger 4 | 5 | logdir="/var/log/service/`(cd ..;basename $PWD)`" 6 | mkdir -p "$logdir" 2>/dev/null 7 | chown -R "$user": "$logdir" 8 | chmod -R go-rwxst,u+rwX "$logdir" 9 | rm logdir 10 | ln -s "$logdir" logdir 11 | 12 | # make this dir accessible to logger 13 | chmod a+rX . 14 | 15 | exec >/dev/null 16 | exec 2>&1 17 | exec \ 18 | env - PATH="$PATH" \ 19 | softlimit \ 20 | setuidgid "$user" \ 21 | svlogd -tt "$logdir" 22 | -------------------------------------------------------------------------------- /examples/var_service/tftpd/p_log: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd log/logdir || exit 1 4 | cat @* current | $PAGER 5 | -------------------------------------------------------------------------------- /examples/var_service/tftpd/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #exec >/dev/null 4 | exec 2>&1 5 | exec &1 | cut -b1-$((w-2))' 5 | -------------------------------------------------------------------------------- /findutils/Config.src: -------------------------------------------------------------------------------- 1 | # 2 | # For a description of the syntax of this configuration file, 3 | # see scripts/kbuild/config-language.txt. 4 | # 5 | 6 | menu "Finding Utilities" 7 | 8 | INSERT 9 | 10 | endmenu 11 | -------------------------------------------------------------------------------- /findutils/Kbuild.src: -------------------------------------------------------------------------------- 1 | # Makefile for busybox 2 | # 3 | # Copyright (C) 1999-2005 by Erik Andersen 4 | # 5 | # Licensed under GPLv2, see file LICENSE in this source tree. 6 | 7 | lib-y:= 8 | 9 | INSERT 10 | -------------------------------------------------------------------------------- /include/.gitignore: -------------------------------------------------------------------------------- 1 | /config 2 | -------------------------------------------------------------------------------- /init/Config.src: -------------------------------------------------------------------------------- 1 | # 2 | # For a description of the syntax of this configuration file, 3 | # see scripts/kbuild/config-language.txt. 4 | # 5 | 6 | menu "Init Utilities" 7 | 8 | INSERT 9 | 10 | endmenu 11 | -------------------------------------------------------------------------------- /init/Kbuild.src: -------------------------------------------------------------------------------- 1 | # Makefile for busybox 2 | # 3 | # Copyright (C) 1999-2005 by Erik Andersen 4 | # 5 | # Licensed under GPLv2, see file LICENSE in this source tree. 6 | 7 | lib-y:= 8 | 9 | INSERT 10 | -------------------------------------------------------------------------------- /libbb/bb_bswap_64.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Utility routines. 3 | * 4 | * Copyright (C) 2010 Denys Vlasenko 5 | * 6 | * Licensed under GPLv2, see file LICENSE in this source tree. 7 | */ 8 | 9 | #include "libbb.h" 10 | 11 | #if !(ULONG_MAX > 0xffffffff) 12 | uint64_t FAST_FUNC bb_bswap_64(uint64_t x) 13 | { 14 | return bswap_64(x); 15 | } 16 | #endif 17 | -------------------------------------------------------------------------------- /libbb/bb_do_delay.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Busybox utility routines. 4 | * 5 | * Copyright (C) 2005 by Tito Ragusa 6 | * 7 | * Licensed under GPLv2, see file LICENSE in this source tree. 8 | */ 9 | 10 | #include "libbb.h" 11 | 12 | void FAST_FUNC bb_do_delay(int seconds) 13 | { 14 | time_t start, now; 15 | 16 | start = time(NULL); 17 | do { 18 | sleep(seconds); 19 | now = time(NULL); 20 | } while ((now - start) < seconds); 21 | } 22 | -------------------------------------------------------------------------------- /libbb/chomp.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Utility routines. 4 | * 5 | * Copyright (C) many different people. 6 | * If you wrote this, please acknowledge your work. 7 | * 8 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 9 | */ 10 | 11 | #include "libbb.h" 12 | 13 | void FAST_FUNC chomp(char *s) 14 | { 15 | char *lc = last_char_is(s, '\n'); 16 | 17 | if (lc) 18 | *lc = '\0'; 19 | } 20 | -------------------------------------------------------------------------------- /libbb/nuke_str.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Utility routines. 4 | * 5 | * Copyright (C) 2008 Denys Vlasenko 6 | * 7 | * Licensed under GPLv2, see file LICENSE in this source tree. 8 | */ 9 | 10 | //kbuild:lib-y += nuke_str.o 11 | 12 | #include "libbb.h" 13 | 14 | void FAST_FUNC nuke_str(char *str) 15 | { 16 | if (str) { 17 | while (*str) 18 | *str++ = 0; 19 | /* or: memset(str, 0, strlen(str)); - not as small as above */ 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /libbb/safe_write.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Utility routines. 4 | * 5 | * Copyright (C) 1999-2004 by Erik Andersen 6 | * 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 8 | */ 9 | 10 | #include "libbb.h" 11 | 12 | ssize_t FAST_FUNC safe_write(int fd, const void *buf, size_t count) 13 | { 14 | ssize_t n; 15 | 16 | do { 17 | n = write(fd, buf, count); 18 | } while (n < 0 && errno == EINTR); 19 | 20 | return n; 21 | } 22 | -------------------------------------------------------------------------------- /libbb/single_argv.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Utility routines. 4 | * 5 | * Copyright (C) 2009 Denys Vlasenko 6 | * 7 | * Licensed under GPLv2, see file LICENSE in this source tree. 8 | */ 9 | #include "libbb.h" 10 | 11 | char* FAST_FUNC single_argv(char **argv) 12 | { 13 | if (argv[1] && strcmp(argv[1], "--") == 0) 14 | argv++; 15 | if (!argv[1] || argv[2]) 16 | bb_show_usage(); 17 | return argv[1]; 18 | } 19 | -------------------------------------------------------------------------------- /libbb/str_tolower.c: -------------------------------------------------------------------------------- 1 | /* vi set: sw=4 ts=4: */ 2 | /* Convert string str to lowercase, return str. 3 | * 4 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 5 | */ 6 | #include "libbb.h" 7 | 8 | char* FAST_FUNC str_tolower(char *str) 9 | { 10 | char *c; 11 | for (c = str; *c; ++c) 12 | *c = tolower(*c); 13 | return str; 14 | } 15 | -------------------------------------------------------------------------------- /libbb/warn_ignoring_args.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * warn_ignoring_args implementation for busybox 4 | * 5 | * Copyright (C) 2003 Manuel Novoa III 6 | * 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 8 | */ 9 | #include "libbb.h" 10 | 11 | #if ENABLE_DESKTOP 12 | void FAST_FUNC bb_warn_ignoring_args(char *arg) 13 | { 14 | if (arg) { 15 | bb_error_msg("ignoring all arguments"); 16 | } 17 | } 18 | #endif 19 | -------------------------------------------------------------------------------- /libbb/xgethostbyname.c: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | /* 3 | * Mini xgethostbyname implementation. 4 | * 5 | * Copyright (C) 2001 Matt Kraai . 6 | * 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. 8 | */ 9 | #include "libbb.h" 10 | 11 | struct hostent* FAST_FUNC xgethostbyname(const char *name) 12 | { 13 | struct hostent *retval = gethostbyname(name); 14 | if (!retval) 15 | bb_herror_msg_and_die("%s", name); 16 | return retval; 17 | } 18 | -------------------------------------------------------------------------------- /libpwdgrp/Kbuild.src: -------------------------------------------------------------------------------- 1 | # Makefile for busybox 2 | # 3 | # Copyright (C) 1999-2005 by Erik Andersen 4 | # 5 | # Licensed under GPLv2, see file LICENSE in this source tree. 6 | 7 | lib-y := uidgid_get.o 8 | 9 | lib-$(CONFIG_USE_BB_PWD_GRP) += pwd_grp.o 10 | -------------------------------------------------------------------------------- /mailutils/Kbuild.src: -------------------------------------------------------------------------------- 1 | # Makefile for busybox 2 | # 3 | # Copyright (C) 1999-2005 by Erik Andersen 4 | # 5 | # Licensed under GPLv2, see file LICENSE in this source tree. 6 | 7 | lib-y:= 8 | 9 | INSERT 10 | -------------------------------------------------------------------------------- /miscutils/fbsplash.cfg: -------------------------------------------------------------------------------- 1 | # progress bar position 2 | BAR_LEFT=90 3 | BAR_TOP=70 4 | BAR_WIDTH=300 5 | BAR_HEIGHT=20 6 | # progress bar color 7 | BAR_R=80 8 | BAR_G=80 9 | BAR_B=130 10 | -------------------------------------------------------------------------------- /modutils/modutils-24.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rovo89/android_external_busybox/bfc653df950d818681510d6004124621bc30240d/modutils/modutils-24.c -------------------------------------------------------------------------------- /networking/libiproute/rtm_map.h: -------------------------------------------------------------------------------- 1 | /* vi: set sw=4 ts=4: */ 2 | #ifndef RTM_MAP_H 3 | #define RTM_MAP_H 1 4 | 5 | PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN 6 | 7 | const char *rtnl_rtntype_n2a(int id, char *buf) FAST_FUNC; 8 | int rtnl_rtntype_a2n(int *id, char *arg) FAST_FUNC; 9 | 10 | int get_rt_realms(uint32_t *realms, char *arg) FAST_FUNC; 11 | 12 | POP_SAVED_FUNCTION_VISIBILITY 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /printutils/Kbuild.src: -------------------------------------------------------------------------------- 1 | # Makefile for busybox 2 | # 3 | # Licensed under GPLv2, see file LICENSE in this source tree. 4 | 5 | lib-y := 6 | 7 | lib-$(CONFIG_LPD) += lpd.o 8 | lib-$(CONFIG_LPR) += lpr.o 9 | lib-$(CONFIG_LPQ) += lpr.o 10 | -------------------------------------------------------------------------------- /scripts/Kbuild.src: -------------------------------------------------------------------------------- 1 | ### 2 | # scripts contains sources for various helper programs used throughout 3 | # the kernel for the build process. 4 | # --------------------------------------------------------------------------- 5 | 6 | # Let clean descend into subdirs 7 | subdir- += basic kconfig 8 | -------------------------------------------------------------------------------- /scripts/basic/.gitignore: -------------------------------------------------------------------------------- 1 | hash 2 | fixdep 3 | docproc 4 | split-include 5 | -------------------------------------------------------------------------------- /scripts/cleanup_printf2puts: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Processes current directory recursively: 4 | # printf("abc\n") -> puts("abc"). Beware of fprintf etc... 5 | 6 | # BTW, gcc 4.1.2 already does the same! Can't believe it... 7 | 8 | grep -lr 'printf\([^%%]*\\n"\)' . | grep '.[ch]$' | xargs -n1 \ 9 | sed -e 's/\([^A-Za-z0-9_]\)printf(\( *"[^%]*\)\\n")/\1puts(\2")/' -i 10 | -------------------------------------------------------------------------------- /scripts/find_bad_common_bufsiz: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This script finds applets with multiple uses of bb_common_bufsiz1 4 | # (== possible bugs). 5 | # Currently (2007-06-04) reports 3 false positives: 6 | # ./coreutils/diff.c:7 7 | # ./loginutils/getty.c:2 8 | # ./util-linux/mount.c:5 9 | 10 | find -name '*.c' \ 11 | | while read name; do 12 | grep -Hc bb_common_bufsiz1 "$name" 13 | done | grep -v ':[01]$' 14 | -------------------------------------------------------------------------------- /scripts/find_stray_common_vars: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Common variables are elusive, they don't show up in size output! 4 | # This script will show all commons in *.o, sorted by size 5 | 6 | find ! -path './scripts/*' -a ! -name built-in.o -a -name '*.o' \ 7 | | while read name; do 8 | b=`basename "$name"` 9 | nm "$name" | sed "s/^/$b: /" 10 | done | grep -i ' c ' | sort -k2 11 | -------------------------------------------------------------------------------- /scripts/gcc-version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # gcc-version gcc-command 4 | # 5 | # Prints the gcc version of `gcc-command' in a canonical 4-digit form 6 | # such as `0295' for gcc-2.95, `0303' for gcc-3.3, etc. 7 | # 8 | 9 | compiler="$*" 10 | 11 | MAJ_MIN=$(echo __GNUC__ __GNUC_MINOR__ | $compiler -E -xc - | tail -n 1) 12 | printf '%02d%02d\n' $MAJ_MIN 13 | -------------------------------------------------------------------------------- /scripts/kconfig/.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # Generated files 3 | # 4 | config* 5 | lex.*.c 6 | *.tab.c 7 | *.tab.h 8 | zconf.hash.c 9 | *.moc 10 | lkc_defs.h 11 | 12 | # 13 | # configuration programs 14 | # 15 | conf 16 | mconf 17 | qconf 18 | gconf 19 | kxgettext 20 | -------------------------------------------------------------------------------- /scripts/kconfig/POTFILES.in: -------------------------------------------------------------------------------- 1 | scripts/kconfig/mconf.c 2 | scripts/kconfig/conf.c 3 | scripts/kconfig/confdata.c 4 | scripts/kconfig/gconf.c 5 | scripts/kconfig/qconf.cc 6 | -------------------------------------------------------------------------------- /scripts/kconfig/check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Needed for systems without gettext 3 | $* -xc -o /dev/null - > /dev/null 2>&1 << EOF 4 | #include 5 | int main() 6 | { 7 | gettext(""); 8 | return 0; 9 | } 10 | EOF 11 | if [ ! "$?" -eq "0" ]; then 12 | echo -DKBUILD_NO_NLS; 13 | fi 14 | -------------------------------------------------------------------------------- /scripts/kconfig/lxdialog/.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # Generated files 3 | # 4 | lxdialog 5 | -------------------------------------------------------------------------------- /scripts/kconfig/lxdialog/BIG.FAT.WARNING: -------------------------------------------------------------------------------- 1 | This is NOT the official version of dialog. This version has been 2 | significantly modified from the original. It was used by the Linux 3 | kernel configuration script, and subsequently adapted for busybox. 4 | Please do not bother Savio Lam with questions about this program. 5 | -------------------------------------------------------------------------------- /scripts/memusage: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | busybox=../busybox 4 | 5 | i=4000 6 | echo "Before we started $i copies of '$busybox sleep 10':" 7 | $busybox nmeter '%t %[pn] %m' | head -3 8 | 9 | while test $i != 0; do 10 | $busybox sleep 10 & 11 | i=$((i-1)) 12 | done 13 | sleep 1 14 | 15 | echo "After:" 16 | $busybox nmeter '%t %[pn] %m' | head -3 17 | -------------------------------------------------------------------------------- /scripts/sample_pmap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | busybox=../busybox 4 | 5 | $busybox sleep 10 & 6 | pid=$! 7 | sleep 1 8 | 9 | echo "Memory map of '$busybox sleep 10':" 10 | size $busybox 11 | pmap $pid | env - grep "^[0-9a-f][0-9a-f]* " | sort -r -t " " -k2,999 12 | -------------------------------------------------------------------------------- /scripts/test_make_O: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | b=`basename $PWD` 4 | test "${b#busybox}" != "$b" || { echo "Must be run in busybox tree"; exit 1; } 5 | 6 | rm -rf ../testdir_make_O.$$ 7 | mkdir ../testdir_make_O.$$ 8 | odir=`cd ../testdir_make_O.$$ && pwd` 9 | test -d "$odir" || exit 1 10 | 11 | make O="$odir" $MAKEOPTS "$@" defconfig busybox 2>&1 | tee test_make_O.log 12 | -------------------------------------------------------------------------------- /scripts/test_make_clean: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | b=`basename $PWD` 4 | test "${b#busybox}" != "$b" || { echo "Must be run in busybox tree"; exit 1; } 5 | 6 | cd .. 7 | cp -pPR "$b" busybox.$$.test_tree 8 | cd busybox.$$.test_tree 9 | make defconfig 10 | make $MAKEOPTS 11 | make clean 12 | cd .. 13 | diff -urp "$b" busybox.$$.test_tree >busybox.$$.test_tree.diff 14 | cat busybox.$$.test_tree.diff 15 | -------------------------------------------------------------------------------- /shell/Kbuild.src: -------------------------------------------------------------------------------- 1 | # Makefile for busybox 2 | # 3 | # Copyright (C) 1999-2005 by Erik Andersen 4 | # 5 | # Licensed under GPLv2, see file LICENSE in this source tree. 6 | 7 | lib-y:= 8 | 9 | INSERT 10 | 11 | lib-$(CONFIG_SH_MATH_SUPPORT) += math.o 12 | -------------------------------------------------------------------------------- /shell/ash_test/ash-alias/alias.right: -------------------------------------------------------------------------------- 1 | alias: 0 2 | alias: 0 3 | ./alias.tests: line 25: qfoo: not found 4 | quux 5 | -------------------------------------------------------------------------------- /shell/ash_test/ash-arith/README.ash: -------------------------------------------------------------------------------- 1 | there is no support for (( )) constructs in ash 2 | -------------------------------------------------------------------------------- /shell/ash_test/ash-arith/arith-bash1.right: -------------------------------------------------------------------------------- 1 | 1 2 | 0 3 | -------------------------------------------------------------------------------- /shell/ash_test/ash-arith/arith-bash1.tests: -------------------------------------------------------------------------------- 1 | # checks for [[ ]] 2 | 3 | # && and || 4 | [[ a && "" ]]; echo $? 5 | [[ a || "" ]]; echo $? 6 | -------------------------------------------------------------------------------- /shell/ash_test/ash-heredoc/heredoc.right: -------------------------------------------------------------------------------- 1 | there 2 | one - alpha 3 | two - beta 4 | three - gamma 5 | hi\ 6 | there$a 7 | stuff 8 | hi\ 9 | there 10 | EO\ 11 | F 12 | hi 13 | tab 1 14 | tab 2 15 | tab 3 16 | abc 17 | def ghi 18 | jkl mno 19 | fff is a shell function 20 | hi 21 | there 22 | -------------------------------------------------------------------------------- /shell/ash_test/ash-invert/invert.right: -------------------------------------------------------------------------------- 1 | 1 2 | 1 3 | 1 4 | 0 5 | 0 6 | 1 7 | 0 8 | 1 9 | 0 10 | 1 11 | -------------------------------------------------------------------------------- /shell/ash_test/ash-misc/echo_write_error.right: -------------------------------------------------------------------------------- 1 | ash: write error: Broken pipe 2 | Ok: 1 3 | -------------------------------------------------------------------------------- /shell/ash_test/ash-misc/echo_write_error.tests: -------------------------------------------------------------------------------- 1 | trap "" PIPE 2 | 3 | { 4 | sleep 1 5 | echo Cant write this - get EPIPE 6 | echo Ok: $? >&2 7 | } | { true; } 8 | -------------------------------------------------------------------------------- /shell/ash_test/ash-misc/last_amp.right: -------------------------------------------------------------------------------- 1 | 3 2 | End 3 | -------------------------------------------------------------------------------- /shell/ash_test/ash-misc/last_amp.tests: -------------------------------------------------------------------------------- 1 | $THIS_SH -c 'echo 3&' 2 | d=`date` 3 | while test "`date`" = "$d"; do true; done 4 | d1=`date` 5 | $THIS_SH -c 'sleep 1&' 6 | d2=`date` 7 | test "$d1" = "$d2" || echo BAD 8 | echo End 9 | -------------------------------------------------------------------------------- /shell/ash_test/ash-misc/nulltick1.right: -------------------------------------------------------------------------------- 1 | Test 1 2 | Test 2 3 | Done 4 | -------------------------------------------------------------------------------- /shell/ash_test/ash-misc/nulltick1.tests: -------------------------------------------------------------------------------- 1 | echo Test ` ` 1 2 | echo Test `../sourced.sh 2 | PATH="..:$PATH" 3 | . sourced.sh 4 | rm ../sourced.sh 5 | echo Done 6 | -------------------------------------------------------------------------------- /shell/ash_test/ash-misc/source2.right: -------------------------------------------------------------------------------- 1 | Done: 0 2 | -------------------------------------------------------------------------------- /shell/ash_test/ash-misc/source2.tests: -------------------------------------------------------------------------------- 1 | false 2 | . /dev/null 3 | echo Done: $? 4 | -------------------------------------------------------------------------------- /shell/ash_test/ash-quoting/dollar_repl_slash_bash1.right: -------------------------------------------------------------------------------- 1 | 192\.168\.0\.1 2 | 192\.168\.0\.1[ 3 | 192\.168\.0\.1[ 4 | 192\\.168\\.0\\.1[ 5 | 192\.168\.0\.1[ 6 | 192\.168\.0\.1 7 | 192\.168\.0\.1[ 8 | 192\.168\.0\.1[ 9 | 192\\.168\\.0\\.1[ 10 | 192\.168\.0\.1[ 11 | -------------------------------------------------------------------------------- /shell/ash_test/ash-quoting/dollar_squote_bash1.right: -------------------------------------------------------------------------------- 1 | a b 2 | a 3 | b c 4 | def 5 | a'b c"d e\f 6 | a3b c3b e33f 7 | a\80b c08b 8 | a3b c30b 9 | x y 10 | -------------------------------------------------------------------------------- /shell/ash_test/ash-quoting/dollar_squote_bash1.tests: -------------------------------------------------------------------------------- 1 | echo $'a\tb' 2 | echo $'a\nb' $'c\nd''ef' 3 | echo $'a\'b' $'c\"d' $'e\\f' 4 | echo $'a\63b' $'c\063b' $'e\0633f' 5 | echo $'a\80b' $'c\608b' 6 | echo $'a\x33b' $'c\x330b' 7 | echo $'x\x9y' 8 | -------------------------------------------------------------------------------- /shell/ash_test/ash-read/read_REPLY.right: -------------------------------------------------------------------------------- 1 | test 1: | abc1 def | 2 | test 2: | \abc2 d\ef | 3 | test 3: |abc3 def| 4 | test 4: |\abc4 d\ef| 5 | Done 6 | -------------------------------------------------------------------------------- /shell/ash_test/ash-read/read_REPLY.tests: -------------------------------------------------------------------------------- 1 | echo ' \abc1 d\ef ' | ( read ; echo "test 1: |$REPLY|" ) 2 | echo ' \abc2 d\ef ' | ( read -r ; echo "test 2: |$REPLY|" ) 3 | echo ' \abc3 d\ef ' | ( read REPLY; echo "test 3: |$REPLY|" ) 4 | echo ' \abc4 d\ef ' | ( read -r REPLY; echo "test 4: |$REPLY|" ) 5 | echo Done 6 | -------------------------------------------------------------------------------- /shell/ash_test/ash-read/read_ifs.right: -------------------------------------------------------------------------------- 1 | test 1: .a. .b. .c. 2 | test 2: .a. .b. .c. 3 | test 3: .a. .. .b,c. 4 | test 4: .a. .. .b,c. 5 | test 5: .a. .. .c. 6 | test 6: .a. .. .c. .d. 7 | test 7: .a. .. .b,c,d , ,. 8 | test 8: .. .a. .b. .c. 9 | test 9: .a. .b. .c. .. 10 | test A: .. .a. .. .b. .c. 11 | -------------------------------------------------------------------------------- /shell/ash_test/ash-read/read_n.right: -------------------------------------------------------------------------------- 1 | test 2 | tes 3 | tes 4 | -------------------------------------------------------------------------------- /shell/ash_test/ash-read/read_n.tests: -------------------------------------------------------------------------------- 1 | echo 'test' | (read reply; echo "$reply") 2 | echo 'test' | (read -n 3 reply; echo "$reply") 3 | echo 'test' | (read -n3 reply; echo "$reply") 4 | -------------------------------------------------------------------------------- /shell/ash_test/ash-read/read_r.right: -------------------------------------------------------------------------------- 1 | testbest 2 | test\ 3 | -------------------------------------------------------------------------------- /shell/ash_test/ash-read/read_r.tests: -------------------------------------------------------------------------------- 1 | echo -e 'test\\\nbest' | (read reply; echo "$reply") 2 | echo -e 'test\\\nbest' | (read -r reply; echo "$reply") 3 | -------------------------------------------------------------------------------- /shell/ash_test/ash-read/read_t.right: -------------------------------------------------------------------------------- 1 | >< 2 | >< 3 | >test< 4 | >test< 5 | -------------------------------------------------------------------------------- /shell/ash_test/ash-read/read_t.tests: -------------------------------------------------------------------------------- 1 | # bash 3.2 outputs: 2 | 3 | # >< 4 | { echo -n 'te'; sleep 2; echo 'st'; } | (read -t 1 reply; echo ">$reply<") 5 | # >< 6 | { sleep 2; echo 'test'; } | (read -t 1 reply; echo ">$reply<") 7 | # >test< 8 | { echo -n 'te'; sleep 1; echo 'st'; } | (read -t 2 reply; echo ">$reply<") 9 | # >test< 10 | { sleep 1; echo 'test'; } | (read -t 2 reply; echo ">$reply<") 11 | -------------------------------------------------------------------------------- /shell/ash_test/ash-redir/redir.right: -------------------------------------------------------------------------------- 1 | ash: write error: Bad file descriptor 2 | TEST 3 | -------------------------------------------------------------------------------- /shell/ash_test/ash-redir/redir.tests: -------------------------------------------------------------------------------- 1 | # test: closed fds should stay closed 2 | exec 1>&- 3 | echo TEST >TEST 4 | echo JUNK # lost: stdout is closed 5 | cat TEST >&2 6 | rm TEST 7 | -------------------------------------------------------------------------------- /shell/ash_test/ash-redir/redir2.right: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /shell/ash_test/ash-redir/redir2.tests: -------------------------------------------------------------------------------- 1 | # ash once couldn't redirect above fd#9 2 | exec 1>/dev/null 3 | (echo LOST1 >&22) 22>&1 4 | (echo LOST2 >&22) 22>&1 5 | (echo OK >&22) 22>&2 6 | -------------------------------------------------------------------------------- /shell/ash_test/ash-redir/redir3.right: -------------------------------------------------------------------------------- 1 | TEST 2 | ./redir3.tests: line 4: 9: Bad file descriptor 3 | Output to fd#9: 1 4 | -------------------------------------------------------------------------------- /shell/ash_test/ash-redir/redir3.tests: -------------------------------------------------------------------------------- 1 | # redirects to closed descriptors should not leave these descriptors 2 | # open afterwards 3 | echo TEST 9>/dev/null 4 | echo MUST ERROR OUT >&9 5 | echo "Output to fd#9: $?" 6 | -------------------------------------------------------------------------------- /shell/ash_test/ash-redir/redir4.right: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /shell/ash_test/ash-redir/redir5.right: -------------------------------------------------------------------------------- 1 | ./redir5.tests: line 2: 10: Bad file descriptor 2 | OK 3 | -------------------------------------------------------------------------------- /shell/ash_test/ash-redir/redir5.tests: -------------------------------------------------------------------------------- 1 | # ash uses fd 10 (usually) for reading the script 2 | echo LOST >&10 3 | echo OK 4 | -------------------------------------------------------------------------------- /shell/ash_test/ash-redir/redir6.right: -------------------------------------------------------------------------------- 1 | Hello 2 | OK 3 | -------------------------------------------------------------------------------- /shell/ash_test/ash-redir/redir6.tests: -------------------------------------------------------------------------------- 1 | # we had a bug where this would hang 2 | (head -n 1 unicode.sh 7 | echo -e 'echo Ok >uni\x81code' >>unicode.sh 8 | echo -e 'cat uni\x81code' >>unicode.sh 9 | echo -e 'cat uni?code' >>unicode.sh 10 | . ./unicode.sh 11 | rm uni*code* 12 | echo Done 13 | -------------------------------------------------------------------------------- /shell/ash_test/ash-redir/redir8.right: -------------------------------------------------------------------------------- 1 | Ok 2 | Ok 3 | Done 4 | -------------------------------------------------------------------------------- /shell/ash_test/ash-redir/redir9.right: -------------------------------------------------------------------------------- 1 | Ok 2 | Done:0 3 | -------------------------------------------------------------------------------- /shell/ash_test/ash-redir/redir9.tests: -------------------------------------------------------------------------------- 1 | echo Ok >file.tmp 2 | cat 0<>file.tmp 3 | echo Done:$? 4 | rm file.tmp 5 | -------------------------------------------------------------------------------- /shell/ash_test/ash-redir/redirA.right: -------------------------------------------------------------------------------- 1 | tmp11 2 | tmp11 3 | -------------------------------------------------------------------------------- /shell/ash_test/ash-redir/redirA.tests: -------------------------------------------------------------------------------- 1 | x="tmp11:tmp22" 2 | 3 | # Bug was incorrectly expanding variables in >redir 4 | echo "${x%:*}" >"${x%:*}" 5 | echo tmp1* 6 | rm tmp1* 7 | 8 | # Also try unquoted 9 | echo "${x%:*}" >${x%:*} 10 | echo tmp1* 11 | rm tmp1* 12 | -------------------------------------------------------------------------------- /shell/ash_test/ash-signals/reap1.right: -------------------------------------------------------------------------------- 1 | Ok 2 | -------------------------------------------------------------------------------- /shell/ash_test/ash-signals/reap1.tests: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Must not find us alive 4 | { sleep 2; kill -9 $$; } 2>/dev/null & 5 | 6 | sleep 1 & 7 | PID=$! 8 | 9 | # We must exit the loop in one second. 10 | # We had bug 5304: builtins never waited for exited children 11 | while kill -0 $PID >/dev/null 2>&1; do 12 | true 13 | done 14 | echo Ok 15 | -------------------------------------------------------------------------------- /shell/ash_test/ash-signals/savetrap.right: -------------------------------------------------------------------------------- 1 | trap -- 'echo Exiting' EXIT 2 | trap -- 'echo WINCH!' WINCH 3 | trap -- 'echo Exiting' EXIT 4 | trap -- 'echo WINCH!' WINCH 5 | trap -- 'echo Exiting' EXIT 6 | trap -- 'echo WINCH!' WINCH 7 | Done 8 | Exiting 9 | -------------------------------------------------------------------------------- /shell/ash_test/ash-signals/savetrap.tests: -------------------------------------------------------------------------------- 1 | trap 'echo Exiting' EXIT 2 | trap 'echo WINCH!' SIGWINCH 3 | v=` trap ` 4 | echo "$v" 5 | v=$( trap ) 6 | echo "$v" 7 | v=`trap` 8 | echo "$v" 9 | echo Done 10 | -------------------------------------------------------------------------------- /shell/ash_test/ash-signals/sigint1.right: -------------------------------------------------------------------------------- 1 | Sending SIGINT to main shell PID 2 | -------------------------------------------------------------------------------- /shell/ash_test/ash-signals/signal1.right: -------------------------------------------------------------------------------- 1 | got signal 2 | trap -- 'echo got signal' USR1 3 | sent 1 signal 4 | got signal 5 | wait interrupted 6 | trap -- 'echo got signal' USR1 7 | sent 2 signal 8 | got signal 9 | wait interrupted 10 | trap -- 'echo got signal' USR1 11 | sent 3 signal 12 | got signal 13 | wait interrupted 14 | trap -- 'echo got signal' USR1 15 | sent 4 signal 16 | got signal 17 | wait interrupted 18 | trap -- 'echo got signal' USR1 19 | sent 5 signal 20 | sleep completed 21 | -------------------------------------------------------------------------------- /shell/ash_test/ash-signals/signal2.right: -------------------------------------------------------------------------------- 1 | child sleeps 2 | child exits as expected 3 | parent exits 4 | -------------------------------------------------------------------------------- /shell/ash_test/ash-signals/signal2.tests: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | $THIS_SH -c ' 4 | cleanup() { 5 | echo "child exits as expected" 6 | exit 7 | } 8 | trap cleanup HUP 9 | echo "child sleeps" 10 | sleep 1 11 | echo "BAD exit from child!" 12 | ' & 13 | 14 | child=$! 15 | sleep 0.1 # let child install handler first 16 | kill -HUP $child 17 | wait 18 | echo "parent exits" 19 | -------------------------------------------------------------------------------- /shell/ash_test/ash-signals/signal3.right: -------------------------------------------------------------------------------- 1 | child sleeps 2 | child got HUP 3 | child exits 4 | parent exits 5 | -------------------------------------------------------------------------------- /shell/ash_test/ash-signals/signal3.tests: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | $THIS_SH -c ' 4 | hup() { 5 | echo "child got HUP" 6 | } 7 | trap hup HUP 8 | echo "child sleeps" 9 | sleep 1 10 | echo "child exits" 11 | ' & 12 | 13 | child=$! 14 | sleep 0.1 # let child install handler first 15 | kill -HUP $child 16 | wait 17 | echo "parent exits" 18 | -------------------------------------------------------------------------------- /shell/ash_test/ash-signals/signal4.right: -------------------------------------------------------------------------------- 1 | ./signal4.tests: trap: line 3: BADNAME: invalid signal specification 2 | 1 3 | Trapped 4 | Ok 5 | -------------------------------------------------------------------------------- /shell/ash_test/ash-signals/signal4.tests: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | trap "echo Trapped" BADNAME TERM; echo $? 4 | kill $$ 5 | echo Ok 6 | -------------------------------------------------------------------------------- /shell/ash_test/ash-signals/signal5.right: -------------------------------------------------------------------------------- 1 | Sleeping 2 | Sleeping 3 | Waiting 4 | 2 sec passed, sending USR1 to parent 5 | USR1 received 6 | Wait exit code: 138 7 | Waiting 8 | 3 sec passed, sending USR1 to parent 9 | USR1 received 10 | Wait exit code: 138 11 | Waiting 12 | Wait returned 0 13 | -------------------------------------------------------------------------------- /shell/ash_test/ash-signals/signal5.tests: -------------------------------------------------------------------------------- 1 | trap "echo USR1 received" USR1 2 | stub() { 3 | echo "Sleeping" 4 | sleep $1 5 | echo "$1 sec passed, sending USR1 to parent" 6 | kill -USR1 $$ 7 | } 8 | stub 3 & 9 | stub 2 & 10 | sleep 1 11 | until { echo "Waiting"; wait; } do 12 | echo "Wait exit code: $?" 13 | done 14 | echo "Wait returned 0" 15 | -------------------------------------------------------------------------------- /shell/ash_test/ash-signals/signal6.right: -------------------------------------------------------------------------------- 1 | got TERM 2 | Done: 0 3 | -------------------------------------------------------------------------------- /shell/ash_test/ash-signals/signal6.tests: -------------------------------------------------------------------------------- 1 | { trap "echo got TERM" TERM; sleep 3; }& sleep 1; kill $!; wait 2 | echo Done: $? 3 | -------------------------------------------------------------------------------- /shell/ash_test/ash-signals/signal7.right: -------------------------------------------------------------------------------- 1 | Bug detected: 0 2 | -------------------------------------------------------------------------------- /shell/ash_test/ash-signals/signal7.tests: -------------------------------------------------------------------------------- 1 | bug() { 2 | trap : exit 3 | # Bug was causing sh to be run in subshell, 4 | # as if this line is replaced with (sh -c ...; exit $?) & 5 | # here: 6 | sh -c 'echo REAL_CHILD=$$' & 7 | echo PARENTS_IDEA_OF_CHILD=$! 8 | wait # make sure bkgd shell completes 9 | } 10 | 11 | bug | { 12 | while read varval; do 13 | eval $varval 14 | done 15 | test x"$REAL_CHILD" != x"" \ 16 | && test x"$REAL_CHILD" = x"$PARENTS_IDEA_OF_CHILD" 17 | echo "Bug detected: $?" 18 | } 19 | -------------------------------------------------------------------------------- /shell/ash_test/ash-signals/signal8.right: -------------------------------------------------------------------------------- 1 | Removing traps 2 | End of exit_func 3 | Done: 0 4 | -------------------------------------------------------------------------------- /shell/ash_test/ash-signals/signal8.tests: -------------------------------------------------------------------------------- 1 | "$THIS_SH" -c ' 2 | exit_func() { 3 | echo "Removing traps" 4 | trap - EXIT TERM INT 5 | echo "End of exit_func" 6 | } 7 | set -e 8 | trap exit_func EXIT TERM INT 9 | sleep 2 10 | exit 77 11 | ' & 12 | 13 | sleep 1 14 | # BUG: ash kills -PGRP, but in non-interactive shell we do not create pgrps! 15 | # In this case, bash kills by PID, not PGRP. 16 | kill -TERM %1 17 | wait 18 | echo Done: $? 19 | -------------------------------------------------------------------------------- /shell/ash_test/ash-signals/signal9.right: -------------------------------------------------------------------------------- 1 | Removing traps 2 | End of exit_func 3 | Done: 0 4 | -------------------------------------------------------------------------------- /shell/ash_test/ash-standalone/noexec_gets_no_env.right: -------------------------------------------------------------------------------- 1 | VAR7=VAL 2 | 0 3 | VAR8=VAL 4 | 0 5 | -------------------------------------------------------------------------------- /shell/ash_test/ash-standalone/noexec_gets_no_env.tests: -------------------------------------------------------------------------------- 1 | export VAR7=VAL 2 | env | grep ^VAR7= 3 | echo $? 4 | VAR8=VAL env | grep ^VAR8= 5 | echo $? 6 | -------------------------------------------------------------------------------- /shell/ash_test/ash-standalone/nofork_trashes_getopt.right: -------------------------------------------------------------------------------- 1 | 0 2 | -------------------------------------------------------------------------------- /shell/ash_test/ash-standalone/nofork_trashes_getopt.tests: -------------------------------------------------------------------------------- 1 | # In this test, rm is NOFORK and it modifies getopt internal state 2 | rm -f non_existent_file 3 | # Subsequent hexdump is run as NOEXEC, and thus still uses this state 4 | hexdump ZVAR=z.tmp 2 | >z.tmp 3 | ZVAR=*.tmp echo ZVAR=*.tmp "ZVAR=*.tmp" "ZVAR=[z].tmp" 4 | ZVAR=*.tmp /bin/echo ZVAR=*.tmp "ZVAR=*.tmp" "ZVAR=[z].tmp" 5 | ZVAR=*.tmp 6 | echo "$ZVAR" 7 | echo $ZVAR 8 | echo ZVAR=*.tmp "ZVAR=*.tmp" "ZVAR=[z].tmp" 9 | /bin/echo ZVAR=*.tmp "ZVAR=*.tmp" "ZVAR=[z].tmp" 10 | rm ZVAR=z.tmp z.tmp 11 | -------------------------------------------------------------------------------- /shell/hush_test/hush-glob/glob_redir.right: -------------------------------------------------------------------------------- 1 | z.tmp: 2 | ?.tmp: TEST 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-glob/glob_redir.tests: -------------------------------------------------------------------------------- 1 | # Redirections are not globbed. 2 | # bash: 3 | # if run as "sh", they are not globbed, but 4 | # if run as "bash", they are! 5 | >z.tmp 6 | echo TEST >?.tmp 7 | echo 'z.tmp:' `cat 'z.tmp'` 8 | echo '?.tmp:' `cat '?.tmp'` 9 | rm 'z.tmp' '?.tmp' 10 | -------------------------------------------------------------------------------- /shell/hush_test/hush-leak/leak_argv1.right: -------------------------------------------------------------------------------- 1 | Measuring memory leak... 2 | Ok 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/and-or.right: -------------------------------------------------------------------------------- 1 | a1 2 | a4 3 | b1 4 | b3 5 | b4 6 | b6 7 | c4 8 | c5 9 | c7 10 | c8 11 | ff1 12 | ff3 13 | ft2 14 | ft3 15 | tf2 16 | tf3 17 | tt2 18 | tt4 19 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/assignment1.right: -------------------------------------------------------------------------------- 1 | if1:0 2 | while1:0 3 | until1:0 4 | if2:0 5 | while2:0 6 | until2:0 7 | if3:0 8 | while3:0 9 | until3:0 10 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/assignment2.rigth: -------------------------------------------------------------------------------- 1 | hush: can't exec 'a=b': No such file or directory 2 | 1 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/assignment2.tests: -------------------------------------------------------------------------------- 1 | # This must not be interpreted as an assignment 2 | a''=b true 3 | echo $? 4 | # (buglet: $? should be 127. it is currently 1) 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/assignment3.right: -------------------------------------------------------------------------------- 1 | Done:0 2 | abc=123 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/assignment3.tests: -------------------------------------------------------------------------------- 1 | # This must be interpreted as assignments 2 | a=1 b\ 3 | =2 c=3 4 | echo Done:$? 5 | echo abc=$a$b$c 6 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/assignment4.right: -------------------------------------------------------------------------------- 1 | Done:0 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/assignment4.tests: -------------------------------------------------------------------------------- 1 | # There was a bug where we misinterpreted assignments after 'do': 2 | for i in 1; do eval b=; done 3 | echo Done:$? 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/break1.right: -------------------------------------------------------------------------------- 1 | A 2 | OK:0 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/break1.tests: -------------------------------------------------------------------------------- 1 | while true; do echo A; break; echo B; done 2 | echo OK:$? 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/break2.right: -------------------------------------------------------------------------------- 1 | A 2 | AA 3 | OK:0 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/break2.tests: -------------------------------------------------------------------------------- 1 | while true; do 2 | echo A 3 | while true; do echo AA; break 2; echo BB; done 4 | echo B 5 | done 6 | echo OK:$? 7 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/break3.right: -------------------------------------------------------------------------------- 1 | A 2 | OK:0 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/break3.tests: -------------------------------------------------------------------------------- 1 | v=break; while true; do echo A; $v; echo B; break; echo C; done 2 | echo OK:$? 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/break4.right: -------------------------------------------------------------------------------- 1 | A 2 | AA 3 | TRUE 4 | A 5 | AA 6 | OK:0 7 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/break4.tests: -------------------------------------------------------------------------------- 1 | cond=true 2 | while $cond; do 3 | echo A 4 | if test "$cond" = true; then 5 | cond='echo TRUE' 6 | else 7 | cond=false 8 | fi 9 | while true; do echo AA; continue 2; echo BB; done 10 | echo B 11 | done 12 | echo OK:$? 13 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/break5.right: -------------------------------------------------------------------------------- 1 | A 2 | B 3 | 0 4 | A:a 5 | B 6 | D 7 | A:b 8 | B 9 | D 10 | A:c 11 | B 12 | D 13 | 0 14 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/break5.tests: -------------------------------------------------------------------------------- 1 | while true; do echo A; { echo B; break; echo C; }; echo D; done 2 | echo $? 3 | for v in a b c; do echo A:$v; (echo B; break; echo C); echo D; done 4 | echo $? 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/builtin1.right: -------------------------------------------------------------------------------- 1 | VARIABLE=export 2 | OK:0 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/builtin1.tests: -------------------------------------------------------------------------------- 1 | # builtins, unlike keywords like "while", can be constructed 2 | # with substitutions 3 | VARIABLE=export 4 | $VARIABLE VARIABLE 5 | env | grep ^VARIABLE 6 | echo OK:$? 7 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/case1.right: -------------------------------------------------------------------------------- 1 | OK_1 2 | OK_1 3 | OK_21 4 | OK_22 5 | OK_23 6 | OK_31 7 | OK_32 8 | OK_41 9 | OK_42 10 | OK_43 11 | OK_44 12 | OK_51 13 | OK_52 14 | OK_53 15 | OK_sub1 16 | OK_sub2 17 | OK_sub3 18 | OK_sub4 19 | OK_sub5 20 | OK_sub6 21 | OK_esac1 22 | Done 23 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/colon.right: -------------------------------------------------------------------------------- 1 | 0 2 | OK: 0 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/colon.tests: -------------------------------------------------------------------------------- 1 | false 2 | : 3 | echo $? 4 | (while :; do exit; done) 5 | echo OK: $? 6 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/compound.right: -------------------------------------------------------------------------------- 1 | new group 2 | 0 3 | 1 4 | 2 5 | 3 6 | 4 7 | 5 8 | 6 9 | new group 10 | new group 11 | 0 12 | 1 13 | 2 14 | 3 15 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/compound.tests: -------------------------------------------------------------------------------- 1 | echo new group 2 | echo 0; { :; } 3 | echo 1; { : ;} 4 | echo 2; ({ :; }) 5 | echo 3; ({ : ;}) 6 | echo 4; ( : ) 7 | echo 5; ( :; ) 8 | echo 6; ( : ;) 9 | # not sure if POSIX requires these, but bash accepts them ... 10 | #echo 7; {( : )} 11 | #echo 8; {( :; )} 12 | #echo 9; {( : ;)} 13 | 14 | echo new group 15 | #echo 0; {(:);} 16 | 17 | echo new group 18 | echo 0; (:) 19 | echo 1; (:;) 20 | echo 2; (:); 21 | echo 3; (:;); 22 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/continue1.right: -------------------------------------------------------------------------------- 1 | A:a 2 | A:b 3 | A:c 4 | OK1 5 | A:a 6 | A:b 7 | A:c 8 | OK2 9 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/continue1.tests: -------------------------------------------------------------------------------- 1 | for v in a b c; do echo A:$v; continue 666; done 2 | echo OK1 3 | for v in a b c; do echo A:$v; continue 666; done 4 | echo OK2 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/continue2.right: -------------------------------------------------------------------------------- 1 | Ok:1 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/continue2.tests: -------------------------------------------------------------------------------- 1 | e='' 2 | (while test $e && exit 1; true; do e=1; continue; done) 3 | echo Ok:$? 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/continue3.right: -------------------------------------------------------------------------------- 1 | 0 2 | 0 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/continue3.tests: -------------------------------------------------------------------------------- 1 | # Test that "continue" does affect exitcode (sets to 0) 2 | e='' 3 | while echo $?; test $e && exit; true; do e=1; false; continue; done 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/echo_write_error.right: -------------------------------------------------------------------------------- 1 | hush: write error: Broken pipe 2 | Ok: 1 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/echo_write_error.tests: -------------------------------------------------------------------------------- 1 | trap "" PIPE 2 | 3 | { 4 | sleep 1 5 | echo Cant write this - get EPIPE 6 | echo Ok: $? >&2 7 | } | { true; } 8 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/empty_args.right: -------------------------------------------------------------------------------- 1 | Null 0th arg: 2 | hush: can't execute '': No such file or directory 3 | 127 4 | Null 1st arg: 5 | 0 6 | Null arg in exec: 7 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/empty_args.tests: -------------------------------------------------------------------------------- 1 | echo Null 0th arg: 2 | "" 3 | echo $? 4 | echo Null 1st arg: 5 | # printf without args would print usage info 6 | printf "" 7 | echo $? 8 | echo Null arg in exec: 9 | exec printf "" 10 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/empty_for.right: -------------------------------------------------------------------------------- 1 | OK: 0 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/empty_for.tests: -------------------------------------------------------------------------------- 1 | false 2 | for a in; do echo "HELLO"; done 3 | echo OK: $? 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/empty_for2.right: -------------------------------------------------------------------------------- 1 | PARAM:abc 2 | PARAM:d e 3 | PARAM:123 4 | OK: 0 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/empty_for2.tests: -------------------------------------------------------------------------------- 1 | if test $# = 0; then 2 | exec "$THIS_SH" $0 abc "d e" 123 3 | fi 4 | false 5 | for v; do echo "PARAM:$v"; done 6 | echo OK: $? 7 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/env_and_func.right: -------------------------------------------------------------------------------- 1 | var=val 2 | var=old 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/env_and_func.tests: -------------------------------------------------------------------------------- 1 | var=old 2 | f() { echo "var=$var"; } 3 | var=val f 4 | echo "var=$var" 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/exec.right: -------------------------------------------------------------------------------- 1 | pass fd out open 2 | pass fd out dup 3 | pass fd out close 4 | pass fd in open 5 | pass fd in dup 6 | pass fd in close 7 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/exit1.right: -------------------------------------------------------------------------------- 1 | Once 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/exit1.tests: -------------------------------------------------------------------------------- 1 | trap "echo Not shown" EXIT 2 | (exit) # must be silent 3 | trap "echo Once; exit" EXIT 4 | { exit; } 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/export-n.right: -------------------------------------------------------------------------------- 1 | export aaa1="'''" 2 | export aaa2='' 3 | export aaa3="'''"'abc' 4 | export aaa8='8' 5 | aaa9=9 6 | aaa10=10 7 | Nothing: 8 | Nothing: 9 | Nothing: 10 | Done 11 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/export.right: -------------------------------------------------------------------------------- 1 | export aaa1="'''" 2 | export aaa2='' 3 | export aaa3="'''"'abc' 4 | export aaa4='def'"'''" 5 | export aaa5="'''"'abc'"'''"'def'"'''" 6 | Done 7 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/export.tests: -------------------------------------------------------------------------------- 1 | export aaa1="'''" 2 | export aaa2="" 3 | export aaa3="'''abc" 4 | export aaa4="def'''" 5 | export aaa5="'''abc'''def'''" 6 | export | grep aaa.= 7 | echo Done 8 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/for_with_bslashes.right: -------------------------------------------------------------------------------- 1 | a 2 | b\c 3 | b\\c 4 | b"c 5 | b'c 6 | b$c 7 | b`true`c 8 | Zero:0 9 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/for_with_bslashes.tests: -------------------------------------------------------------------------------- 1 | # UNFIXED BUG. 2 | # commented-out words contain ^C character. 3 | # It's a SPECIAL_VAR_SYMBOL, for now hush does not escape it. 4 | # When it is fixed, update this test. 5 | 6 | for a in 'a' 'b\c' 'b\\c' 'b"c' "b'c" 'b$c' 'b`true`c' ### 'b#c' 7 | do 8 | echo $a 9 | done 10 | echo Zero:$? 11 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/for_with_keywords.right: -------------------------------------------------------------------------------- 1 | do 2 | done 3 | then 4 | OK: 0 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/for_with_keywords.tests: -------------------------------------------------------------------------------- 1 | for if in do done then; do echo $if; done 2 | echo OK: $? 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/func1.right: -------------------------------------------------------------------------------- 1 | Hello 2 | Zero: 0 3 | One: 1 Param1: World 4 | Zero: 0 Param1: Restored 5 | Multi line function 6 | One: 1 7 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/func1.tests: -------------------------------------------------------------------------------- 1 | f() { echo Hello; } 2 | g () { echo One: $# Param1: $1; } 3 | h ( ) 4 | { 5 | echo -n 'Multi ' && echo -n 'line ' 6 | echo function 7 | false 8 | } 9 | 10 | f 11 | echo Zero: $? 12 | set -- Restored 13 | { g World; } 14 | echo Zero: $? Param1: $1 15 | ( h ) 16 | echo One: $? 17 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/func2.right: -------------------------------------------------------------------------------- 1 | First 0 2 | Second 0 3 | First 1 4 | Second 1 5 | Done 6 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/func2.tests: -------------------------------------------------------------------------------- 1 | i=0 2 | while test $i != 2; do 3 | f() { echo First $i; } 4 | f 5 | f() { echo Second $i; } 6 | f 7 | : $((i++)) 8 | done 9 | echo Done 10 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/func3.right: -------------------------------------------------------------------------------- 1 | One:1 2 | Zero:0 3 | One:1 4 | Five:5 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/func3.tests: -------------------------------------------------------------------------------- 1 | f() { false; return; echo BAD; }; 2 | { f; echo One:$?; }; echo Zero:$? 3 | 4 | f() { false; return; }; 5 | f; echo One:$? 6 | 7 | f() { return 5; }; 8 | f; echo Five:$? 9 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/func4.right: -------------------------------------------------------------------------------- 1 | 24 2 | Done 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/func4.tests: -------------------------------------------------------------------------------- 1 | func() { 2 | eval "echo \"\${val_${1}}\"" 3 | } 4 | 5 | val_x=24 6 | (func x) 7 | echo Done 8 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/func5.right: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/func5.tests: -------------------------------------------------------------------------------- 1 | f() { echo $1; } 2 | f 1 3 | 4 | # hush fails on this syntax, but i've never seen anyone use it ... 5 | #f() ( echo $1; ) 6 | f 2 7 | 8 | #f() ( echo $1 ) 9 | f 3 10 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/func_args1.right: -------------------------------------------------------------------------------- 1 | params: a b c 2 | 'f 1 2 3' called 3 | params: a b c 4 | 'f 1 2 3' called 5 | params: a b c 6 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/func_args1.tests: -------------------------------------------------------------------------------- 1 | # UNFIXED BUG 2 | 3 | f() { echo "'f $1 $2 $3' called"; } 4 | 5 | set -- a b c 6 | echo "params: $1 $2 $3" 7 | f 1 2 3 8 | echo "params: $1 $2 $3" 9 | true | f 1 2 3 10 | echo "params: $1 $2 $3" 11 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/func_local1.right: -------------------------------------------------------------------------------- 1 | z=a 2 | z=z 3 | Done 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/func_local1.tests: -------------------------------------------------------------------------------- 1 | export z=z 2 | f() { local z=a; env | grep ^z; } 3 | f 4 | env | grep ^z 5 | echo Done 6 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/func_local2.right: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 1 4 | 2 5 | 1 6 | 1 7 | 2 8 | 2 9 | 3 10 | 2 11 | 2 12 | 3 13 | 1 14 | Done 15 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/func_local2.tests: -------------------------------------------------------------------------------- 1 | x=1 2 | f() { echo $x; local x=$((x+1)); echo $x; } 3 | g() { f; echo $x; f; local x=$((x+1)); f; echo $x; f; } 4 | f 5 | g 6 | echo $x 7 | echo Done 8 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/heredoc1.right: -------------------------------------------------------------------------------- 1 | qwe 2 | asd 3 | 123 4 | 456 5 | Ok 6 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/heredoc1.tests: -------------------------------------------------------------------------------- 1 | cat <<000; cat <"$0.tmp" 3 | yes "123456789 123456789 123456789 123456789" | head -3000 >>"$0.tmp" 4 | echo 'HERE' >>"$0.tmp" 5 | 6 | yes "123456789 123456789 123456789 123456789" | head -3000 | md5sum 7 | . "$0.tmp" 8 | rm "$0.tmp" 9 | echo End 10 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/if_false_exitcode.right: -------------------------------------------------------------------------------- 1 | Ok:0 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/if_false_exitcode.tests: -------------------------------------------------------------------------------- 1 | if false; then echo Bad; fi 2 | echo Ok:$? 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/nommu1.right: -------------------------------------------------------------------------------- 1 | Ok 2 | Ok 3 | Ok 4 | Ok 5 | Ok 6 | Ok 7 | Done 8 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/nommu1.tests: -------------------------------------------------------------------------------- 1 | (echo \ 2 | Ok) 3 | ( (echo \ 4 | Ok) ) 5 | ( ( (echo \ 6 | Ok) ) ) 7 | 8 | (echo \Ok) 9 | ( (echo \Ok) ) 10 | ( ( (echo \Ok) ) ) 11 | 12 | echo Done 13 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/nommu2.right: -------------------------------------------------------------------------------- 1 | Ok 2 | Ok 3 | Ok 4 | Ok 5 | Done 6 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/nommu2.tests: -------------------------------------------------------------------------------- 1 | echo Not shown | if true; then echo $(echo Ok); fi 2 | echo Not shown | if true; then echo `echo Ok`; fi 3 | echo Not shown | ( if true; then echo $(echo Ok); fi ) 4 | echo Not shown | ( if true; then echo `echo Ok`; fi ) 5 | echo Done 6 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/opts1.right: -------------------------------------------------------------------------------- 1 | Param1: >-10qwertyuiop< 2 | Done 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/opts1.tests: -------------------------------------------------------------------------------- 1 | if test $# = 0; then 2 | exec "$THIS_SH" $0 -10qwertyuiop 3 | fi 4 | echo "Param1: >$1<" 5 | echo Done 6 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/pid.right: -------------------------------------------------------------------------------- 1 | 0 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/pid.tests: -------------------------------------------------------------------------------- 1 | test `(echo $$)` = `echo $$`; echo $? 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/pipefail.right: -------------------------------------------------------------------------------- 1 | Default: 2 | true | true: 3 | 0 4 | 1 5 | true | false: 6 | 1 7 | 0 8 | false | true: 9 | 0 10 | 1 11 | exit 2 | exit 3 | exit 4: 12 | 4 13 | 0 14 | Pipefail on: 15 | true | true: 16 | 0 17 | 1 18 | true | false: 19 | 1 20 | 0 21 | false | true: 22 | 1 23 | 0 24 | exit 2 | exit 3 | exit 4: 25 | 4 26 | 0 27 | Pipefail off: 28 | true | true: 29 | 0 30 | 1 31 | true | false: 32 | 1 33 | 0 34 | false | true: 35 | 0 36 | 1 37 | exit 2 | exit 3 | exit 4: 38 | 4 39 | 0 40 | Done 41 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/read.right: -------------------------------------------------------------------------------- 1 | read 2 | cat 3 | echo "REPLY=$REPLY" 4 | REPLY=exec /dev/null 2 | echo Ok 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/redir3.right: -------------------------------------------------------------------------------- 1 | hush: can't open '/does/not/exist': No such file or directory 2 | One:1 3 | hush: can't open '/cant/be/created': No such file or directory 4 | One:1 5 | Ok 6 | hush: can't open '/cant/be/created': No such file or directory 7 | Zero:0 8 | hush: can't open '/cant/be/created': No such file or directory 9 | One:1 10 | hush: can't open '/cant/be/created': No such file or directory 11 | One:1 12 | hush: can't open '/cant/be/created': No such file or directory 13 | Zero:0 14 | Done 15 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/redir3.tests: -------------------------------------------------------------------------------- 1 | echo Error >/does/not/exist; echo One:$? 2 | t=BAD 3 | t=Ok >>/cant/be/created; echo One:$? 4 | echo $t 5 | ! >/cant/be/created; echo Zero:$? 6 | exec >/cant/be/created; echo One:$? 7 | exec /bin/true >/cant/be/created; echo One:$? 8 | ! exec /bin/true >/cant/be/created; echo Zero:$? 9 | echo Done 10 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/redir4.right: -------------------------------------------------------------------------------- 1 | shell_test 2 | \shell_test 3 | \shell_test 4 | \shell_test 5 | Here1 6 | Ok1 7 | Here2 8 | Ok2 9 | Here3 10 | Ok3 11 | Here4 12 | Ok4 13 | Now with variable refs 14 | shell_test_1 15 | \shell_test_1 16 | \shell_test_1 17 | \shell_test_1 18 | Done 19 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/redir5.right: -------------------------------------------------------------------------------- 1 | Backgrounded pipes shall have their stdin redirected to /dev/null 2 | Zero:0 3 | Zero:0 4 | Done 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/redir5.tests: -------------------------------------------------------------------------------- 1 | echo "Backgrounded pipes shall have their stdin redirected to /dev/null" 2 | 3 | # 1. bash does not redirect stdin to /dev/null if it is interactive. 4 | # hush does it always (this is allowed by standards). 5 | 6 | # 2. Failure will result in this script hanging 7 | 8 | cat & wait; echo Zero:$? 9 | 10 | # This does not work for bash! bash bug? 11 | cat | cat & wait; echo Zero:$? 12 | 13 | echo Done 14 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/redir6.right: -------------------------------------------------------------------------------- 1 | Testing multiple redirections to same fd 2 | Hello 3 | Done1 4 | Done2 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/redir6.tests: -------------------------------------------------------------------------------- 1 | echo "Testing multiple redirections to same fd" 2 | # bug was making us lose fd #1 after this: 3 | echo Hello >/dev/null 1>&2 4 | echo Done1 5 | echo Done2 >&2 6 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/return1.right: -------------------------------------------------------------------------------- 1 | Ok:0 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/return1.tests: -------------------------------------------------------------------------------- 1 | echo "true && return; echo Should not be printed" >return_sourced 2 | . ./return_sourced 3 | rm return_sourced 4 | echo Ok:$? 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/shift.right: -------------------------------------------------------------------------------- 1 | ./shift.tests abc d e 2 | ./shift.tests d e 123 3 | ./shift.tests d e 123 4 | ./shift.tests 5 | ./shift.tests 6 | ./shift.tests 7 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/shift.tests: -------------------------------------------------------------------------------- 1 | if test $# = 0; then 2 | exec "$THIS_SH" $0 abc "d e" 123 3 | fi 4 | echo $0 $1 $2 5 | shift 6 | echo $0 $1 $2 7 | shift 999 8 | echo $0 $1 $2 9 | shift 2 10 | echo $0 $1 $2 11 | shift 2 12 | echo $0 $1 $2 13 | shift 14 | echo $0 $1 $2 15 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/sig_exitcode.right: -------------------------------------------------------------------------------- 1 | KILL 2 | 137:137 3 | KILL 4 | 0:0 5 | Done 6 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/sig_exitcode.tests: -------------------------------------------------------------------------------- 1 | exec 2>&1 2 | 3 | $THIS_SH -c 'kill -9 $$' 4 | echo 137:$? 5 | 6 | ! $THIS_SH -c 'kill -9 $$' 7 | echo 0:$? 8 | 9 | echo Done 10 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/sigint1.right: -------------------------------------------------------------------------------- 1 | Sending SIGINT to main shell PID 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/source1.right: -------------------------------------------------------------------------------- 1 | hush: syntax error: unterminated ${name} 2 | line2 3 | Ok1:0 4 | hush: syntax error: unterminated ' 5 | Ok2:1 6 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/source1.tests: -------------------------------------------------------------------------------- 1 | echo 'echo ${^} 2 | echo line2' >sourced1 3 | . ./sourced1 4 | echo Ok1:$? 5 | 6 | echo "echo '" >sourced1 7 | . ./sourced1 8 | echo Ok2:$? 9 | 10 | rm sourced1 11 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/source2.right: -------------------------------------------------------------------------------- 1 | 0:arg0 1:arg1 2:arg2 2 | Ok1:0 3 | 0:arg0 1:q 2:w 4 | Ok2:0 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/source2.tests: -------------------------------------------------------------------------------- 1 | echo 'echo "0:$0 1:$1 2:$2"' >sourced1 2 | set -- 1 2 3 3 | "$THIS_SH" -c '. ./sourced1' arg0 arg1 arg2 4 | echo Ok1:$? 5 | "$THIS_SH" -c '. ./sourced1 q w e' arg0 arg1 arg2 6 | echo Ok2:$? 7 | 8 | rm sourced1 9 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/syntax_err.right: -------------------------------------------------------------------------------- 1 | shown 2 | hush: syntax error: unterminated ' 3 | test 4 | not shown 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/syntax_err.tests: -------------------------------------------------------------------------------- 1 | echo shown 2 | echo test `echo 'aa` 3 | echo not shown 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/syntax_err_negate.right: -------------------------------------------------------------------------------- 1 | bash 3.2 fails this 2 | hush: syntax error: ! ! command 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/syntax_err_negate.tests: -------------------------------------------------------------------------------- 1 | echo bash 3.2 fails this 2 | ! ! true 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/until1.right: -------------------------------------------------------------------------------- 1 | 1 2 | 1 3 | Ok:0 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/until1.tests: -------------------------------------------------------------------------------- 1 | x=1 2 | until test "$x" = 4; do echo $x; x=4; done 3 | 4 | # We had a bug in multi-line form 5 | x=1 6 | until test "$x" = 4; do 7 | echo $x 8 | x=4 9 | done 10 | 11 | echo Ok:$? 12 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/while1.right: -------------------------------------------------------------------------------- 1 | OK:0 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/while1.tests: -------------------------------------------------------------------------------- 1 | while false; do echo NOT SHOWN; done 2 | echo OK:$? 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/while2.right: -------------------------------------------------------------------------------- 1 | Hello 2 | OK:0 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/while2.tests: -------------------------------------------------------------------------------- 1 | while echo Hello; false; do echo NOT SHOWN; done 2 | echo OK:$? 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/while3.right: -------------------------------------------------------------------------------- 1 | OK:0 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/while3.tests: -------------------------------------------------------------------------------- 1 | while false; do 2 | # bash will require at least ":" here... 3 | done 4 | echo OK:$? 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/while4.right: -------------------------------------------------------------------------------- 1 | Ok:0 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/while4.tests: -------------------------------------------------------------------------------- 1 | false 2 | while false && echo Not reached; do 3 | echo BUG 4 | break 5 | done 6 | echo Ok:$? 7 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/while_in_subshell.right: -------------------------------------------------------------------------------- 1 | OK: 0 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-misc/while_in_subshell.tests: -------------------------------------------------------------------------------- 1 | (while true; do exit; done) 2 | echo OK: $? 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/argv0.right: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/argv0.tests: -------------------------------------------------------------------------------- 1 | if test $# = 0; then 2 | exec "$THIS_SH" "$0" arg 3 | fi 4 | echo OK 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/brace1.right: -------------------------------------------------------------------------------- 1 | {abc} 2 | { 3 | } 4 | hush: can't execute '{cmd': No such file or directory 5 | hush: can't execute '{': No such file or directory 6 | hush: can't execute '{': No such file or directory 7 | Done: 127 8 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/brace1.tests: -------------------------------------------------------------------------------- 1 | echo {abc} 2 | echo { 3 | echo } 4 | {cmd 5 | ""{ 6 | {"" 7 | echo Done: $? 8 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/brace2.right: -------------------------------------------------------------------------------- 1 | {q,w} 2 | {q,w} 3 | Done 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/brace2.tests: -------------------------------------------------------------------------------- 1 | v='{q,w}' 2 | # Should not brace-expand v value 3 | echo $v 4 | echo "$v" 5 | echo Done 6 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/comment1.right: -------------------------------------------------------------------------------- 1 | Nothing: 2 | String: #should-be-echoed 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/comment1.tests: -------------------------------------------------------------------------------- 1 | echo Nothing: #should-not-be-echoed 2 | echo String: ""#should-be-echoed 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/eol1.right: -------------------------------------------------------------------------------- 1 | Done:0 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/eol1.tests: -------------------------------------------------------------------------------- 1 | # bug was that we treated as ';' in this line: 2 | true || echo foo | 3 | echo BAD1 | cat 4 | 5 | # variation on the same theme 6 | true || echo foo | 7 | # comment 8 | echo BAD2 | cat 9 | 10 | # variation on the same theme 11 | true || echo foo | 12 | 13 | echo BAD3 | cat 14 | 15 | # this should error out, but currently works in hush: 16 | #true || echo foo |; 17 | 18 | echo Done:$? 19 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/escape1.right: -------------------------------------------------------------------------------- 1 | \ 2 | a\b 3 | \\ 4 | c\\d 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/escape1.tests: -------------------------------------------------------------------------------- 1 | test "$CONFIG_FEATURE_FANCY_ECHO" = "y" || exit 77 2 | 3 | echo "\\" 4 | echo a"\\"b 5 | echo '\\' 6 | echo c'\\'d 7 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/escape2.right: -------------------------------------------------------------------------------- 1 | *?[a]* 2 | a*?[a]*b 3 | *?[a]* 4 | c*?[a]*d 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/escape2.tests: -------------------------------------------------------------------------------- 1 | echo "*?[a]*" 2 | echo a"*?[a]*"b 3 | echo '*?[a]*' 4 | echo c'*?[a]*'d 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/escape3.right: -------------------------------------------------------------------------------- 1 | v: a \ b \\ c \\\ d \\\\ e 2 | v: a \ b \\ c \\\ d \\\\ e 3 | Unquoted: 4 | .a. 5 | .\. 6 | .b. 7 | .\\. 8 | .c. 9 | .\\\. 10 | .d. 11 | .\\\\. 12 | .e. 13 | Quoted: 14 | .a. 15 | .\. 16 | .b. 17 | .\\. 18 | .c. 19 | .\\\. 20 | .d. 21 | .\\\\. 22 | .e. 23 | done 24 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/escape3.tests: -------------------------------------------------------------------------------- 1 | test "$CONFIG_FEATURE_FANCY_ECHO" = "y" || exit 77 2 | 3 | v='a \ b \\ c \\\ d \\\\ e' 4 | echo v: $v 5 | echo v: "$v" 6 | echo Unquoted: 7 | for a in $v; do echo .$a.; done 8 | echo Quoted: 9 | for a in $v; do echo ".$a."; done 10 | echo done 11 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/escape4.right: -------------------------------------------------------------------------------- 1 | Ok 2 | End 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/escape4.tests: -------------------------------------------------------------------------------- 1 | i\ 2 | f tr\ 3 | ue; th\ 4 | en echo "O\ 5 | k"; fi; echo "\ 6 | End" -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/escape5.right: -------------------------------------------------------------------------------- 1 | a\nb\nc\n 2 | a 3 | b 4 | c 5 | a\nb\nc\n 6 | a 7 | b 8 | c 9 | Done 10 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/escape5.tests: -------------------------------------------------------------------------------- 1 | v="a\nb\nc\n" 2 | echo "$v" 3 | printf "$v" 4 | v='a\nb\nc\n' 5 | echo "$v" 6 | printf "$v" 7 | echo Done 8 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/group1.right: -------------------------------------------------------------------------------- 1 | word} } 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/group1.tests: -------------------------------------------------------------------------------- 1 | { echo word} }; } 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/group2.right: -------------------------------------------------------------------------------- 1 | got TERM 2 | Done: 0 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/group2.tests: -------------------------------------------------------------------------------- 1 | # Bug was in handling of "}&" without space 2 | { trap "echo got TERM" TERM; sleep 2; }& sleep 1; kill $!; wait 3 | echo Done: $? 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/groups_and_keywords1.right: -------------------------------------------------------------------------------- 1 | Semicolons after } can be omitted 1: 2 | foo 3 | bar 4 | Semicolons after } can be omitted 2: 5 | foo 6 | bar 7 | Semicolons after fi can be omitted: 8 | foo 9 | bar 10 | baz 11 | Done:0 12 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/groups_and_keywords1.tests: -------------------------------------------------------------------------------- 1 | echo "Semicolons after } can be omitted 1:" 2 | if { echo foo; } then { echo bar; } fi 3 | 4 | echo "Semicolons after } can be omitted 2:" 5 | while { echo foo; } do { echo bar; break; } done 6 | 7 | echo "Semicolons after fi can be omitted:" 8 | while if echo foo; then echo bar; fi do echo baz; break; done 9 | 10 | echo Done:$? 11 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/negate.right: -------------------------------------------------------------------------------- 1 | ! printing ! 2 | 0 3 | 1 4 | 1 5 | 0 6 | 0 7 | 0 8 | ! 9 | a 10 | b 11 | c 12 | ! 1 13 | a 1 14 | b 1 15 | c 1 16 | ! 1 17 | a 1 18 | b 1 19 | c 1 20 | 0 21 | 0 22 | 0 23 | 0 24 | 1 25 | 1 26 | 1 27 | 1 28 | 0 29 | 0 30 | 0 31 | 0 32 | 1 33 | 1 34 | 1 35 | 1 36 | Done 37 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/noeol.right: -------------------------------------------------------------------------------- 1 | HELLO 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/noeol.tests: -------------------------------------------------------------------------------- 1 | # next line has no EOL! 2 | echo HELLO -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/noeol2.right: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/noeol2.tests: -------------------------------------------------------------------------------- 1 | # last line has no EOL! 2 | if true 3 | then 4 | echo 1 5 | else 6 | echo 2 7 | fi -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/noeol3.right: -------------------------------------------------------------------------------- 1 | hush: syntax error: unterminated " 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/noeol3.tests: -------------------------------------------------------------------------------- 1 | # last line has no EOL! 2 | echo "unterminated -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/process_subst.right: -------------------------------------------------------------------------------- 1 | TESTzzBEST 2 | TEST$(echo zz)BEST 3 | TEST'BEST 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/process_subst.tests: -------------------------------------------------------------------------------- 1 | echo "TEST`echo zz;echo;echo`BEST" 2 | echo "TEST`echo '$(echo zz)'`BEST" 3 | echo "TEST`echo "'"`BEST" 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/quote1.right: -------------------------------------------------------------------------------- 1 | '1' 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/quote1.tests: -------------------------------------------------------------------------------- 1 | a=1 2 | echo "'$a'" 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/quote2.right: -------------------------------------------------------------------------------- 1 | >1 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/quote2.tests: -------------------------------------------------------------------------------- 1 | a=1 2 | echo ">$a" 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/quote3.right: -------------------------------------------------------------------------------- 1 | Testing: in "" 2 | .. 3 | Testing: in '' 4 | .. 5 | Testing: in $empty 6 | Testing: in $empty"" 7 | .. 8 | Testing: in $empty'' 9 | .. 10 | Testing: in "$empty" 11 | .. 12 | Finished 13 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/quote4.right: -------------------------------------------------------------------------------- 1 | a b 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/quote4.tests: -------------------------------------------------------------------------------- 1 | a_b='a b' 2 | echo "$a_b" 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/redir_space.right: -------------------------------------------------------------------------------- 1 | z1.tmp: 1 2 | z2.tmp: 1 3 | "z1.tmp z2.tmp": TEST 0 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/redir_space.tests: -------------------------------------------------------------------------------- 1 | v='z1.tmp z2.tmp' 2 | echo TEST >$v 3 | echo 'z1.tmp:' `cat 'z1.tmp' 2>/dev/null; echo $?` 4 | echo 'z2.tmp:' `cat 'z2.tmp' 2>/dev/null; echo $?` 5 | echo '"z1.tmp z2.tmp":' `cat 'z1.tmp z2.tmp' 2>/dev/null; echo $?` 6 | rm z*.tmp 7 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/starquoted.right: -------------------------------------------------------------------------------- 1 | .1 abc d e f. 2 | .1. 3 | .abc. 4 | .d e f. 5 | .-1 abc d e f-. 6 | .-1. 7 | .abc. 8 | .d e f-. 9 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/starquoted.tests: -------------------------------------------------------------------------------- 1 | if test $# = 0; then 2 | exec "$THIS_SH" "$0" 1 abc 'd e f' 3 | fi 4 | 5 | for a in "$*"; do echo ".$a."; done 6 | for a in "$@"; do echo ".$a."; done 7 | for a in "-$*-"; do echo ".$a."; done 8 | for a in "-$@-"; do echo ".$a."; done 9 | -------------------------------------------------------------------------------- /shell/hush_test/hush-parsing/starquoted2.right: -------------------------------------------------------------------------------- 1 | Should be printed 2 | Would not be printed by bash 3 | Would not be printed by bash 4 | Would not be printed by bash 5 | Should be printed 6 | Empty: 7 | Empty: 8 | Empty: 9 | -------------------------------------------------------------------------------- /shell/hush_test/hush-psubst/emptytick.right: -------------------------------------------------------------------------------- 1 | 0 2 | 0 3 | hush: can't execute '': No such file or directory 4 | 127 5 | hush: can't execute '': No such file or directory 6 | 127 7 | 0 8 | 0 9 | 0 10 | 0 11 | hush: can't execute '': No such file or directory 12 | 127 13 | hush: can't execute '': No such file or directory 14 | 127 15 | 0 16 | 0 17 | hush: can't execute '': No such file or directory 18 | -------------------------------------------------------------------------------- /shell/hush_test/hush-psubst/emptytick.tests: -------------------------------------------------------------------------------- 1 | true; ``; echo $? 2 | false; ``; echo $? 3 | true; `""`; echo $? 4 | false; `""`; echo $? 5 | true; ` `; echo $? 6 | false; ` `; echo $? 7 | 8 | true; $(); echo $? 9 | false; $(); echo $? 10 | true; $(""); echo $? 11 | false; $(""); echo $? 12 | true; $( ); echo $? 13 | false; $( ); echo $? 14 | 15 | exec ''; echo $? 16 | echo Not reached 17 | -------------------------------------------------------------------------------- /shell/hush_test/hush-psubst/tick.right: -------------------------------------------------------------------------------- 1 | 1 2 | 1 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-psubst/tick.tests: -------------------------------------------------------------------------------- 1 | true 2 | false; echo `echo $?` 3 | true 4 | { false; echo `echo $?`; } 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-psubst/tick2.right: -------------------------------------------------------------------------------- 1 | BAZ 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-psubst/tick2.tests: -------------------------------------------------------------------------------- 1 | if false; then 2 | echo "FOO" 3 | tmp=`echo BAR >&2` 4 | fi 5 | echo BAZ 6 | -------------------------------------------------------------------------------- /shell/hush_test/hush-psubst/tick3.right: -------------------------------------------------------------------------------- 1 | \TESTZZBEST 2 | $TEST 3 | Q 4 | a\bc 5 | 11-$a-\t-\-\"-`-\--\z-\*-\?-22 33-$a-\t-\-"-`-\--\z-\*-\?-44 6 | done:0 7 | -------------------------------------------------------------------------------- /shell/hush_test/hush-psubst/tick3.tests: -------------------------------------------------------------------------------- 1 | test "$CONFIG_FEATURE_FANCY_ECHO" = "y" || exit 77 2 | 3 | TEST=Q 4 | # \` is special 5 | echo `echo '\'TEST\`echo ZZ\`BEST` 6 | # \$ and \\ are special 7 | echo `echo \\$TEST` 8 | echo `echo \$TEST` 9 | echo a`echo \\\\b`c 10 | 11 | # \" is not special if in unquoted `cmd` (passed verbatim WITH \), 12 | # but is special in quoted one 13 | echo `echo 11'-$a-\t-\\-\"-\`-\--\z-\*-\?-'22` "`echo 33'-$a-\t-\\-\"-\`-\--\z-\*-\?-'44`" 14 | echo done:$? 15 | -------------------------------------------------------------------------------- /shell/hush_test/hush-psubst/tick4.right: -------------------------------------------------------------------------------- 1 | (TEST) BEST 2 | TEST) BEST 3 | ((TEST) BEST 4 | ) 5 | abc 6 | a)c 7 | OK: 0 8 | -------------------------------------------------------------------------------- /shell/hush_test/hush-psubst/tick4.tests: -------------------------------------------------------------------------------- 1 | echo $(echo '(TEST)' BEST) 2 | echo $(echo 'TEST)' BEST) 3 | echo $(echo \(\(TEST\) BEST) 4 | echo $(echo \)) 5 | echo $(echo a"`echo "b"`"c ) 6 | echo $(echo a"`echo ")"`"c ) 7 | echo OK: $? 8 | -------------------------------------------------------------------------------- /shell/hush_test/hush-psubst/tick5.right: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-psubst/tick5.tests: -------------------------------------------------------------------------------- 1 | true; echo `false` $? 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-psubst/tick_huge.right: -------------------------------------------------------------------------------- 1 | 546ed3f5c81c780d3ab86ada14824237 - 2 | 546ed3f5c81c780d3ab86ada14824237 - 3 | End 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-psubst/tick_huge.tests: -------------------------------------------------------------------------------- 1 | # This creates 120k file 2 | yes "123456789 123456789 123456789 123456789" | head -3000 >>"$0.tmp" 3 | 4 | echo "`cat $0.tmp`" | md5sum 5 | rm "$0.tmp" 6 | yes "123456789 123456789 123456789 123456789" | head -3000 | md5sum 7 | echo End 8 | -------------------------------------------------------------------------------- /shell/hush_test/hush-read/read_REPLY.right: -------------------------------------------------------------------------------- 1 | test 1: | abc1 def | 2 | test 2: | \abc2 d\ef | 3 | test 3: |abc3 def| 4 | test 4: |\abc4 d\ef| 5 | Done 6 | -------------------------------------------------------------------------------- /shell/hush_test/hush-read/read_REPLY.tests: -------------------------------------------------------------------------------- 1 | echo ' \abc1 d\ef ' | ( read ; echo "test 1: |$REPLY|" ) 2 | echo ' \abc2 d\ef ' | ( read -r ; echo "test 2: |$REPLY|" ) 3 | echo ' \abc3 d\ef ' | ( read REPLY; echo "test 3: |$REPLY|" ) 4 | echo ' \abc4 d\ef ' | ( read -r REPLY; echo "test 4: |$REPLY|" ) 5 | echo Done 6 | -------------------------------------------------------------------------------- /shell/hush_test/hush-read/read_ifs.right: -------------------------------------------------------------------------------- 1 | test 1: .a. .b. .c. 2 | test 2: .a. .b. .c. 3 | test 3: .a. .. .b,c. 4 | test 4: .a. .. .b,c. 5 | test 5: .a. .. .c. 6 | test 6: .a. .. .c. .d. 7 | test 7: .a. .. .b,c,d , ,. 8 | test 8: .. .a. .b. .c. 9 | test 9: .a. .b. .c. .. 10 | test A: .. .a. .. .b. .c. 11 | -------------------------------------------------------------------------------- /shell/hush_test/hush-read/read_n.right: -------------------------------------------------------------------------------- 1 | test 2 | tes 3 | tes 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-read/read_n.tests: -------------------------------------------------------------------------------- 1 | echo 'test' | (read reply; echo "$reply") 2 | echo 'test' | (read -n 3 reply; echo "$reply") 3 | echo 'test' | (read -n3 reply; echo "$reply") 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-read/read_r.right: -------------------------------------------------------------------------------- 1 | testbest 2 | test\ 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-read/read_r.tests: -------------------------------------------------------------------------------- 1 | echo -e 'test\\\nbest' | (read reply; echo "$reply") 2 | echo -e 'test\\\nbest' | (read -r reply; echo "$reply") 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-read/read_t.right: -------------------------------------------------------------------------------- 1 | >< 2 | >< 3 | >test< 4 | >test< 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-read/read_t.tests: -------------------------------------------------------------------------------- 1 | # bash 3.2 outputs: 2 | 3 | # >< 4 | { echo -n 'te'; sleep 2; echo 'st'; } | (read -t 1 reply; echo ">$reply<") 5 | # >< 6 | { sleep 2; echo 'test'; } | (read -t 1 reply; echo ">$reply<") 7 | # >test< 8 | { echo -n 'te'; sleep 1; echo 'st'; } | (read -t 2 reply; echo ">$reply<") 9 | # >test< 10 | { sleep 1; echo 'test'; } | (read -t 2 reply; echo ">$reply<") 11 | -------------------------------------------------------------------------------- /shell/hush_test/hush-trap/catch.right: -------------------------------------------------------------------------------- 1 | sending USR2 2 | caught 3 | sending USR2 4 | sending USR2 5 | USR2 6 | -------------------------------------------------------------------------------- /shell/hush_test/hush-trap/catch.tests: -------------------------------------------------------------------------------- 1 | # avoid ugly warnings about signals not being caught 2 | trap ":" USR1 USR2 3 | 4 | "$THIS_SH" -c ' 5 | trap "echo caught" USR2 6 | echo "sending USR2" 7 | kill -USR2 $$ 8 | 9 | trap "" USR2 10 | echo "sending USR2" 11 | kill -USR2 $$ 12 | 13 | trap "-" USR2 14 | echo "sending USR2" 15 | kill -USR2 $$ 16 | 17 | echo "not reached" 18 | ' 19 | 20 | trap "-" USR1 USR2 21 | -------------------------------------------------------------------------------- /shell/hush_test/hush-trap/exit.right: -------------------------------------------------------------------------------- 1 | cow 2 | moo 3 | Traps1: 4 | trap -- 'exitfunc' EXIT 5 | Traps2: 6 | trap -- 'echo Should not run' EXIT 7 | Check1: 42 8 | Traps1: 9 | trap -- 'exitfunc' EXIT 10 | Traps2: 11 | trap -- 'echo Should not run' EXIT 12 | Check2: 42 13 | -------------------------------------------------------------------------------- /shell/hush_test/hush-trap/save-ret.right: -------------------------------------------------------------------------------- 1 | YEAH 2 | 0 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-trap/save-ret.tests: -------------------------------------------------------------------------------- 1 | # make sure we do not corrupt $? across traps 2 | trap "echo YEAH; false" USR1 3 | kill -USR1 $$ 4 | echo $? 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-trap/savetrap.right: -------------------------------------------------------------------------------- 1 | trap -- 'echo Exiting' EXIT 2 | trap -- 'echo WINCH!' WINCH 3 | trap -- 'echo Exiting' EXIT 4 | trap -- 'echo WINCH!' WINCH 5 | trap -- 'echo Exiting' EXIT 6 | trap -- 'echo WINCH!' WINCH 7 | Done 8 | Exiting 9 | -------------------------------------------------------------------------------- /shell/hush_test/hush-trap/savetrap.tests: -------------------------------------------------------------------------------- 1 | trap 'echo Exiting' EXIT 2 | trap 'echo WINCH!' SIGWINCH 3 | v=` trap ` 4 | echo "$v" 5 | v=$( trap ) 6 | echo "$v" 7 | v=`trap` 8 | echo "$v" 9 | echo Done 10 | -------------------------------------------------------------------------------- /shell/hush_test/hush-trap/signal7.right: -------------------------------------------------------------------------------- 1 | Bug detected: 0 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-trap/signal7.tests: -------------------------------------------------------------------------------- 1 | bug() { 2 | trap : exit 3 | # Bug was causing sh to be run in subshell, 4 | # as if this line is replaced with (sh -c ...; exit $?) & 5 | # here: 6 | sh -c 'echo REAL_CHILD=$$' & 7 | echo PARENTS_IDEA_OF_CHILD=$! 8 | wait # make sure bkgd shell completes 9 | } 10 | 11 | bug | { 12 | while read varval; do 13 | eval $varval 14 | done 15 | test x"$REAL_CHILD" != x"" \ 16 | && test x"$REAL_CHILD" = x"$PARENTS_IDEA_OF_CHILD" 17 | echo "Bug detected: $?" 18 | } 19 | -------------------------------------------------------------------------------- /shell/hush_test/hush-trap/signal_read1.right: -------------------------------------------------------------------------------- 1 | Got HUP:0 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-trap/signal_read1.tests: -------------------------------------------------------------------------------- 1 | (sleep 1; kill -HUP $$) & 2 | trap 'echo "Got HUP:$?"; exit' HUP 3 | while true; do 4 | read ignored 5 | done 6 | -------------------------------------------------------------------------------- /shell/hush_test/hush-trap/signal_read2.right: -------------------------------------------------------------------------------- 1 | HUP 2 | Done:129 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-trap/signal_read2.tests: -------------------------------------------------------------------------------- 1 | $THIS_SH -c ' 2 | (sleep 1; kill -HUP $$) & 3 | while true; do 4 | read ignored 5 | done 6 | ' 7 | echo "Done:$?" 8 | -------------------------------------------------------------------------------- /shell/hush_test/hush-trap/subshell.right: -------------------------------------------------------------------------------- 1 | trap -- '' HUP 2 | trap -- '' QUIT 3 | trap -- '' SYS 4 | Ok 5 | trap -- '' HUP 6 | trap -- '' QUIT 7 | trap -- '' SYS 8 | Ok 9 | trap -- '' HUP 10 | trap -- '' QUIT 11 | trap -- '' SYS 12 | Ok 13 | trap -- '' HUP 14 | trap -- '' QUIT 15 | trap -- '' SYS 16 | Ok 17 | trap -- '' HUP 18 | trap -- '' QUIT 19 | trap -- '' SYS 20 | TERM 21 | Done 22 | -------------------------------------------------------------------------------- /shell/hush_test/hush-trap/usage.right: -------------------------------------------------------------------------------- 1 | ___ 2 | ___ 3 | ___ 4 | trap -- 'a' EXIT 5 | trap -- 'a' INT 6 | trap -- 'a' USR1 7 | trap -- 'a' USR2 8 | ___ 9 | ___ 10 | trap -- 'a' USR1 11 | trap -- 'a' USR2 12 | ___ 13 | ___ 14 | trap -- 'a' USR2 15 | -------------------------------------------------------------------------------- /shell/hush_test/hush-trap/usage.tests: -------------------------------------------------------------------------------- 1 | # no output -- default state 2 | echo ___ 3 | trap 4 | 5 | # assign some traps 6 | echo ___ 7 | trap "a" EXIT INT USR1 USR2 8 | 9 | # show them all 10 | echo ___ 11 | trap 12 | 13 | # clear one 14 | echo ___ 15 | trap 0 INT 16 | echo ___ 17 | trap 18 | 19 | # clear another 20 | echo ___ 21 | trap "-" USR1 22 | echo ___ 23 | trap 24 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/empty.right: -------------------------------------------------------------------------------- 1 | a b c d e f 1 2 3 4 5 6 7 8 9 0 A B C D E F 2 | a b c d e f 1 2 3 4 5 6 7 8 9 0 A B C D E F 3 | a b c d e f 1 2 3 4 5 6 7 8 9 0 A B C D E F 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/empty.tests: -------------------------------------------------------------------------------- 1 | e= 2 | 3 | echo a b c d e f 1 2 3 4 5 6 7 8 9 0 A B C D E F 4 | echo a $e b $e c $e d $e e $e f $e 1 $e 2 $e 3 $e 4 $e 5 $e 6 $e 7 $e 8 $e 9 $e 0 $e A $e B $e C $e D $e E $e F 5 | echo $e a $e b $e c $e d $e e $e f $e 1 $e 2 $e 3 $e 4 $e 5 $e 6 $e 7 $e 8 $e 9 $e 0 $e A $e B $e C $e D $e E $e F 6 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/glob_and_vars.right: -------------------------------------------------------------------------------- 1 | ./glob_and_vars.right ./glob_and_vars.tests 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/glob_and_vars.tests: -------------------------------------------------------------------------------- 1 | v=. 2 | echo $v/glob_and_vars.[tr]* 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/param_expand_alt.right: -------------------------------------------------------------------------------- 1 | hush: syntax error: unterminated ${name} 2 | hush: syntax error: unterminated ${name} 3 | __ __ 4 | _ _ _ _ _ 5 | _aaaa _ _ _word _word 6 | _ _ _ _ _ 7 | _ _ _ _word _ 8 | _fff _ _ _word _word 9 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/param_expand_assign.right: -------------------------------------------------------------------------------- 1 | hush: syntax error: unterminated ${name} 2 | hush: syntax error: unterminated ${name} 3 | 0 4 | 0 5 | hush: $1: cannot assign in this way 6 | hush: $1: cannot assign in this way 7 | hush: $1: cannot assign in this way 8 | hush: $1: cannot assign in this way 9 | _aa 10 | _aa 11 | _aa 12 | _aa 13 | _ 14 | _ 15 | _ 16 | _word 17 | _word 18 | _ 19 | _ 20 | _ 21 | _ 22 | _word 23 | _fff 24 | _fff 25 | _fff 26 | _fff 27 | _fff 28 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/param_expand_default.right: -------------------------------------------------------------------------------- 1 | hush: syntax error: unterminated ${name} 2 | hush: syntax error: unterminated ${name} 3 | _0 _0 4 | _ _ _ _word _word 5 | _aaaa _aaaa _aaaa _aaaa _aaaa 6 | _ _ _ _word _word 7 | _ _ _ _ _word 8 | _fff _fff _fff _fff _fff 9 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/param_expand_len.right: -------------------------------------------------------------------------------- 1 | 0 2 | 0 3 | 1 4 | Make sure len parsing doesnt break arg count 5 | 0 0 6 | 4 4 7 | Testing len op 8 | 4 3 2 1 0 0 9 | 0 3 0 10 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/param_expand_len.tests: -------------------------------------------------------------------------------- 1 | "$THIS_SH" -c 'echo $#' 2 | "$THIS_SH" -c 'echo $#' arg0 3 | "$THIS_SH" -c 'echo $#' arg0 arg1 4 | 5 | echo Make sure len parsing doesnt break arg count 6 | set -- 7 | echo $# ${#} 8 | set -- aaaa bbb cc d 9 | echo $# ${#} 10 | 11 | echo Testing len op 12 | echo ${#1} ${#2} ${#3} ${#4} ${#5} ${#6} 13 | 14 | unset e 15 | f=abc 16 | g= 17 | echo ${#e} ${#f} ${#g} 18 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/param_glob.right: -------------------------------------------------------------------------------- 1 | param_glob.tests 2 | param_glob.tests 3 | param_glob.t* 4 | param_glob.t* 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/param_glob.tests: -------------------------------------------------------------------------------- 1 | if test $# = 0; then 2 | exec "$THIS_SH" "$0" 'param_glob.t*' 3 | echo NOT SHOWN 4 | exit 5 | fi 6 | echo $* 7 | echo $@ 8 | echo "$*" 9 | echo "$@" 10 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/param_subshell.right: -------------------------------------------------------------------------------- 1 | 1=1 2 | 2=2 3 | 3=3 4 | 4=4 5 | 5=5 6 | 6=6 7 | 7=7 8 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/param_subshell.tests: -------------------------------------------------------------------------------- 1 | if test $# = 0; then 2 | "$THIS_SH" "$0" 1 2 3 4 5 6 7 8 9 3 | exit 4 | fi 5 | echo 1=$1 6 | { echo 2=$2; } 7 | { echo 3=$3; } & 8 | # cant use usleep as it isnt standard in $PATH -- 9 | # we fail when testing busybox compiled solely as "hush" 10 | wait 11 | ( echo 4=$4 ) 12 | ( echo 5=$5 ) & 13 | wait 14 | true | echo 6=$6 | cat 15 | true | { echo 7=$7; } | cat 16 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/star.right: -------------------------------------------------------------------------------- 1 | .1. 2 | .abc. 3 | .d. 4 | .e. 5 | .f. 6 | .1 abc d e f. 7 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/star.tests: -------------------------------------------------------------------------------- 1 | if test $# = 0; then 2 | exec "$THIS_SH" star.tests 1 abc 'd e f' 3 | fi 4 | # 'd e f' should be split into 3 separate args: 5 | for a in $*; do echo ".$a."; done 6 | 7 | # must produce .1 abc d e f. 8 | for a in "$*"; do echo ".$a."; done 9 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/unset.right: -------------------------------------------------------------------------------- 1 | 0 2 | unset: invalid option -- m 3 | 1 4 | 0 5 | ___ 6 | 0 f g 7 | 0 g 8 | 0 9 | ___ 10 | 0 f g 11 | 0 12 | 0 f g 13 | 0 14 | ___ 15 | hush: HUSH_VERSION: readonly variable 16 | 1 f g 17 | hush: HUSH_VERSION: readonly variable 18 | 1 19 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var1.right: -------------------------------------------------------------------------------- 1 | http://busybox.net 2 | http://busybox.net_abc 3 | 1 1 4 | 1 1 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var1.tests: -------------------------------------------------------------------------------- 1 | URL=http://busybox.net 2 | 3 | echo $URL 4 | echo ${URL}_abc 5 | 6 | true 7 | false; echo $? ${?} 8 | true 9 | { false; echo $? ${?}; } 10 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var2.right: -------------------------------------------------------------------------------- 1 | http://busybox.net 2 | http://busybox.net_abc 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var2.tests: -------------------------------------------------------------------------------- 1 | _1=http://busybox.net 2 | 3 | echo $_1 4 | echo ${_1}_abc 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var3.right: -------------------------------------------------------------------------------- 1 | hush: invalid number '1q' 2 | hush: syntax error: unterminated ${name} 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var3.tests: -------------------------------------------------------------------------------- 1 | # reject invalid vars 2 | "$THIS_SH" -c 'echo ${1q}' 3 | "$THIS_SH" -c 'echo ${&}' 4 | #"$THIS_SH" -c 'echo ${$}' -- this is valid as it's the same as $$ 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_bash1.right: -------------------------------------------------------------------------------- 1 | 2 | 3 | f 4 | bcdef 5 | abcdef 6 | abcdef 7 | bcde 8 | abcd 9 | abcd 10 | abcdef 11 | bcdef 12 | abcdef 13 | abcdef 14 | abcdef 15 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_bash1.tests: -------------------------------------------------------------------------------- 1 | var=abcdef 2 | 3 | echo ${var:7} 4 | echo ${var:6} 5 | echo ${var:5} 6 | echo ${var:1} 7 | echo ${var:0} 8 | echo ${var:-1} 9 | 10 | echo ${var:1:4} 11 | echo ${var:0:4} 12 | echo ${var::4} 13 | echo ${var:-1:4} 14 | 15 | echo ${var:1:7} 16 | echo ${var:0:7} 17 | echo ${var::7} 18 | echo ${var:-1:7} 19 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_bash2.right: -------------------------------------------------------------------------------- 1 | abc123xcba123 2 | abx123dcba123 3 | abx123dxba123 4 | abcx23dcba123 5 | abcxxxdcbaxxx 6 | abx 7 | xba123 8 | abx23 9 | abc23dcba123 10 | abcdcba 11 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_bash3.right: -------------------------------------------------------------------------------- 1 | 1 a041#c 2 | 2 a041#c 3 | 3 a\041#c 4 | 4 a\041#c 5 | 5 a\041#c 6 | 6 a\041#c 7 | 7 a\041#c 8 | 8 a\041#c 9 | 9 a\041#c 10 | 10 a\c 11 | 11 a\c 12 | 12 a\c 13 | 13 a\\c 14 | 14 a\\c 15 | 15 a\\c 16 | 16 a\tc 17 | 17 a\tc 18 | 18 a\tc 19 | 19 atc 20 | 20 a\tc 21 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_bash5.right: -------------------------------------------------------------------------------- 1 | 1 a/ 2 | 2 a/d 3 | 3 a/e/f 4 | 4 a\ 5 | 5 a\d 6 | 6 a\e\f 7 | 7 a\\ 8 | 8 a\\d 9 | 9 a\\e\\f 10 | a ab 11 | Done: 0 12 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_bash6.right: -------------------------------------------------------------------------------- 1 | Expected Actual 2 | a*z : a*z 3 | \z : \z 4 | a1z a2z: a1z a2z 5 | z : z 6 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_bash6.tests: -------------------------------------------------------------------------------- 1 | # This testcase checks globbing correctness in ${v/a/b} 2 | 3 | >a1z; >a2z; 4 | echo 'Expected' 'Actual' 5 | v='a bz'; echo 'a*z :' "${v/a*z/a*z}" 6 | v='a bz'; echo '\z :' "${v/a*z/\z}" 7 | v='a bz'; echo 'a1z a2z:' ${v/a*z/a*z} 8 | v='a bz'; echo 'z :' ${v/a*z/\z} 9 | rm a1z a2z 10 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_expand_in_assign.right: -------------------------------------------------------------------------------- 1 | . . 2 | .abc d e. 3 | .abc d e. 4 | .abc d e. 5 | .abc d e. 6 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_expand_in_assign.tests: -------------------------------------------------------------------------------- 1 | if test $# = 0; then 2 | exec "$THIS_SH" "$0" abc "d e" 3 | fi 4 | 5 | space=' ' 6 | echo .$space. 7 | 8 | a=$* 9 | echo .$a. 10 | a=$@ 11 | echo .$a. 12 | a="$*" 13 | echo .$a. 14 | a="$@" 15 | echo .$a. 16 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_expand_in_redir.right: -------------------------------------------------------------------------------- 1 | TEST1 2 | TEST2 3 | TEST3 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_expand_in_redir.tests: -------------------------------------------------------------------------------- 1 | if test $# = 0; then 2 | exec "$THIS_SH" "$0" abc "d e" 3 | fi 4 | 5 | echo TEST1 >"$1.out" 6 | echo TEST2 >"$2.out" 7 | # bash says: "$@.out": ambiguous redirect 8 | # ash handles it as if it is '$*' - we do the same 9 | echo TEST3 >"$@.out" 10 | 11 | cat abc.out "d e.out" "abc d e.out" 12 | 13 | rm abc.out "d e.out" "abc d e.out" 14 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_expand_on_ifs.right: -------------------------------------------------------------------------------- 1 | 1 a b c 2 | 2 a + b c 3 | 3 a b c 4 | 4 a b c 5 | 5 a b c 6 | 6 a b + c 7 | 7 a b c 8 | 8 a b c 9 | 9 a b c 10 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_expand_on_ifs.tests: -------------------------------------------------------------------------------- 1 | b=' b ' 2 | e='' 3 | echo 1 a $b c 4 | echo 2 a +$b c 5 | echo 3 a $e$b c 6 | echo 4 a "$e"$b c 7 | echo 5 a ""$b c 8 | echo 6 a $b+ c 9 | echo 7 a $b$e c 10 | echo 8 a $b"$e" c 11 | echo 9 a $b"" c 12 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_in_pipes.right: -------------------------------------------------------------------------------- 1 | b=1 2 | b=2 3 | b=3 4 | b=4 5 | b=5 6 | b=6 7 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_in_pipes.tests: -------------------------------------------------------------------------------- 1 | b=1 env | grep ^b= 2 | true | b=2 env | grep ^b= 3 | a=1 true | b=3 env | grep ^b= 4 | 5 | (b=4 env) | grep ^b= 6 | (true | b=5 env) | grep ^b= 7 | (a=1 true | b=6 env) | grep ^b= 8 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_leaks.right: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_leaks.tests: -------------------------------------------------------------------------------- 1 | # external program 2 | a=b /bin/true 3 | env | grep ^a= 4 | 5 | # builtin 6 | a=b true 7 | env | grep ^a= 8 | 9 | # exec with redirection only 10 | # in bash, this leaks! 11 | a=b exec 1>&1 12 | env | grep ^a= 13 | 14 | echo OK 15 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_preserved.right: -------------------------------------------------------------------------------- 1 | a=b 2 | a=b 3 | a=b 4 | OK 5 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_preserved.tests: -------------------------------------------------------------------------------- 1 | export a=b 2 | 3 | # external program 4 | a=c /bin/true 5 | env | grep ^a= 6 | 7 | # builtin 8 | a=d true 9 | env | grep ^a= 10 | 11 | # exec with redirection only 12 | # in bash, this leaks! 13 | a=e exec 1>&1 14 | env | grep ^a= 15 | 16 | echo OK 17 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_serial.right: -------------------------------------------------------------------------------- 1 | Assignments only: c=a 2 | Assignments and a command: c=a 3 | Assignments and a builtin: c=a 4 | Assignments and a function: c=a 5 | Done 6 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_serial.tests: -------------------------------------------------------------------------------- 1 | a=a 2 | 3 | b=b 4 | c=c 5 | # Second assignment depends on the first: 6 | b=$a c=$b 7 | echo Assignments only: c=$c 8 | 9 | b=b 10 | c=c 11 | b=$a c=$b "$THIS_SH" -c 'echo Assignments and a command: c=$c' 12 | 13 | b=b 14 | c=c 15 | b=$a c=$b eval 'echo Assignments and a builtin: c=$c' 16 | 17 | b=b 18 | c=c 19 | f() { echo Assignments and a function: c=$c; } 20 | b=$a c=$b f 21 | 22 | echo Done 23 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_unbackslash.right: -------------------------------------------------------------------------------- 1 | b1=-qwerty-t-\-"-`---z-*-?- 2 | b1=-qwerty-t-\-"-`---z-*-?- 3 | b2=-qwerty-\t-\-"-`-\--\z-\*-\?- 4 | b2=-qwerty-\t-\-"-`-\--\z-\*-\?- 5 | b3=-$a-\t-\\-\"-\`-\--\z-\*-\?- 6 | b3=-$a-\t-\\-\"-\`-\--\z-\*-\?- 7 | c=-$a-\t-\\-\"-\`-\--\z-\*-\?- 8 | c=-$a-\t-\\-\"-\`-\--\z-\*-\?- 9 | c=-$a-\t-\\-\"-\`-\--\z-\*-\?- 10 | c=-$a-\t-\\-\"-\`-\--\z-\*-\?- 11 | Done: 0 12 | -------------------------------------------------------------------------------- /shell/hush_test/hush-vars/var_unbackslash.tests: -------------------------------------------------------------------------------- 1 | # Test for correct handling of backslashes 2 | a=qwerty 3 | 4 | b=-$a-\t-\\-\"-\`-\--\z-\*-\?- 5 | echo b1=$b 6 | echo "b1=$b" 7 | b="-$a-\t-\\-\"-\`-\--\z-\*-\?-" 8 | echo b2=$b 9 | echo "b2=$b" 10 | b='-$a-\t-\\-\"-\`-\--\z-\*-\?-' 11 | echo b3=$b 12 | echo "b3=$b" 13 | 14 | c=$b 15 | echo "c=$c" 16 | c=${b} 17 | echo "c=$c" 18 | c="$b" 19 | echo "c=$c" 20 | c="${b}" 21 | echo "c=$c" 22 | 23 | echo "Done: $?" 24 | -------------------------------------------------------------------------------- /shell/hush_test/hush-z_slow/leak_all1.right: -------------------------------------------------------------------------------- 1 | Warm up 2 | Measuring memory leak... 3 | Ok 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-z_slow/leak_all2.right: -------------------------------------------------------------------------------- 1 | Warm up 2 | Measuring memory leak... 3 | Ok 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-z_slow/leak_empty_tick.right: -------------------------------------------------------------------------------- 1 | Warm up 2 | Measuring memory leak... 3 | Ok 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-z_slow/leak_empty_tick.tests: -------------------------------------------------------------------------------- 1 | echo "Warm up" 2 | i=1 3 | while test $i != 9; do 4 | `true` 5 | : $((i++)) 6 | done 7 | 8 | memleak 9 | 10 | echo "Measuring memory leak..." 11 | i=1 12 | while test $i != 199; do 13 | `true` 14 | : $((i++)) 15 | done 16 | i=1 17 | while test $i != 199; do 18 | `true` 19 | : $((i++)) 20 | done 21 | 22 | memleak 23 | kb=$? 24 | if test $kb -le 4; then 25 | echo Ok #$kb 26 | else 27 | echo "Bad: $kb kb (or more) leaked" 28 | fi 29 | -------------------------------------------------------------------------------- /shell/hush_test/hush-z_slow/leak_heredoc1.right: -------------------------------------------------------------------------------- 1 | Warm up 2 | Measuring memory leak... 3 | Ok 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-z_slow/leak_var.right: -------------------------------------------------------------------------------- 1 | Measuring memory leak... 2 | Ok 3 | -------------------------------------------------------------------------------- /shell/hush_test/hush-z_slow/leak_var2.right: -------------------------------------------------------------------------------- 1 | Warm up 2 | Measuring memory leak... 3 | Ok 4 | -------------------------------------------------------------------------------- /shell/hush_test/hush-z_slow/leak_var3.right: -------------------------------------------------------------------------------- 1 | Warm up 2 | Measuring memory leak... 3 | Ok 4 | -------------------------------------------------------------------------------- /shell/msh_test/msh-bugs/noeol3.right: -------------------------------------------------------------------------------- 1 | hush: syntax error: unterminated " 2 | -------------------------------------------------------------------------------- /shell/msh_test/msh-bugs/noeol3.tests: -------------------------------------------------------------------------------- 1 | # last line has no EOL! 2 | echo "unterminated -------------------------------------------------------------------------------- /shell/msh_test/msh-bugs/process_subst.right: -------------------------------------------------------------------------------- 1 | TESTzzBEST 2 | TEST$(echo zz)BEST 3 | TEST'BEST 4 | -------------------------------------------------------------------------------- /shell/msh_test/msh-bugs/process_subst.tests: -------------------------------------------------------------------------------- 1 | echo "TEST`echo zz;echo;echo`BEST" 2 | echo "TEST`echo '$(echo zz)'`BEST" 3 | echo "TEST`echo "'"`BEST" 4 | -------------------------------------------------------------------------------- /shell/msh_test/msh-bugs/read.right: -------------------------------------------------------------------------------- 1 | read 2 | cat 3 | echo "REPLY=$REPLY" 4 | REPLY=exec "$1.out" 6 | echo TEST2 >"$2.out" 7 | # bash says: "$@.out": ambiguous redirect 8 | # ash handles it as if it is '$*' - we do the same 9 | echo TEST3 >"$@.out" 10 | 11 | cat abc.out "d e.out" "abc d e.out" 12 | 13 | rm abc.out "d e.out" "abc d e.out" 14 | -------------------------------------------------------------------------------- /shell/msh_test/msh-execution/exitcode_EACCES.right: -------------------------------------------------------------------------------- 1 | ./: can't execute 2 | 126 3 | -------------------------------------------------------------------------------- /shell/msh_test/msh-execution/exitcode_EACCES.tests: -------------------------------------------------------------------------------- 1 | ./ 2 | echo $? 3 | -------------------------------------------------------------------------------- /shell/msh_test/msh-execution/exitcode_ENOENT.right: -------------------------------------------------------------------------------- 1 | ./does_not_exist_for_sure: not found 2 | 127 3 | -------------------------------------------------------------------------------- /shell/msh_test/msh-execution/exitcode_ENOENT.tests: -------------------------------------------------------------------------------- 1 | ./does_not_exist_for_sure 2 | echo $? 3 | -------------------------------------------------------------------------------- /shell/msh_test/msh-execution/many_continues.right: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /shell/msh_test/msh-execution/many_continues.tests: -------------------------------------------------------------------------------- 1 | if test $# = 0; then 2 | # Child will kill us in 1 second 3 | "$THIS_SH" "$0" $$ & 4 | 5 | # Loop many, many times 6 | trap 'echo OK; exit 0' 15 7 | while true; do 8 | continue 9 | done 10 | echo BAD 11 | exit 1 12 | fi 13 | 14 | sleep 1 15 | kill $1 16 | -------------------------------------------------------------------------------- /shell/msh_test/msh-execution/nested_break.right: -------------------------------------------------------------------------------- 1 | A 2 | B 3 | iteration 4 | C 5 | A 6 | B 7 | iteration 8 | D 9 | -------------------------------------------------------------------------------- /shell/msh_test/msh-execution/nested_break.tests: -------------------------------------------------------------------------------- 1 | # Testcase for http://bugs.busybox.net/view.php?id=846 2 | 3 | n=0 4 | while : 5 | do 6 | echo A 7 | while : 8 | do 9 | echo B 10 | break 11 | done 12 | echo iteration 13 | [ $n = 1 ] && break 14 | echo C 15 | n=`expr $n + 1` 16 | done 17 | echo D 18 | -------------------------------------------------------------------------------- /shell/msh_test/msh-misc/tick.right: -------------------------------------------------------------------------------- 1 | 1 2 | 1 3 | -------------------------------------------------------------------------------- /shell/msh_test/msh-misc/tick.tests: -------------------------------------------------------------------------------- 1 | true 2 | false; echo `echo $?` 3 | true 4 | { false; echo `echo $?`; } 5 | -------------------------------------------------------------------------------- /shell/msh_test/msh-parsing/argv0.right: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /shell/msh_test/msh-parsing/argv0.tests: -------------------------------------------------------------------------------- 1 | if test $# = 0; then 2 | exec "$THIS_SH" "$0" arg 3 | fi 4 | echo OK 5 | -------------------------------------------------------------------------------- /shell/msh_test/msh-parsing/noeol.right: -------------------------------------------------------------------------------- 1 | HELLO 2 | -------------------------------------------------------------------------------- /shell/msh_test/msh-parsing/noeol.tests: -------------------------------------------------------------------------------- 1 | # next line has no EOL! 2 | echo HELLO -------------------------------------------------------------------------------- /shell/msh_test/msh-parsing/noeol2.right: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /shell/msh_test/msh-parsing/noeol2.tests: -------------------------------------------------------------------------------- 1 | # last line has no EOL! 2 | if true 3 | then 4 | echo 1 5 | else 6 | echo 2 7 | fi -------------------------------------------------------------------------------- /shell/msh_test/msh-parsing/quote1.right: -------------------------------------------------------------------------------- 1 | '1' 2 | -------------------------------------------------------------------------------- /shell/msh_test/msh-parsing/quote1.tests: -------------------------------------------------------------------------------- 1 | a=1 2 | echo "'$a'" 3 | -------------------------------------------------------------------------------- /shell/msh_test/msh-parsing/quote2.right: -------------------------------------------------------------------------------- 1 | >1 2 | -------------------------------------------------------------------------------- /shell/msh_test/msh-parsing/quote2.tests: -------------------------------------------------------------------------------- 1 | a=1 2 | echo ">$a" 3 | -------------------------------------------------------------------------------- /shell/msh_test/msh-parsing/quote3.right: -------------------------------------------------------------------------------- 1 | Testing: in $empty"" 2 | .. 3 | Finished 4 | -------------------------------------------------------------------------------- /shell/msh_test/msh-parsing/quote3.tests: -------------------------------------------------------------------------------- 1 | if test $# = 0; then 2 | exec "$THIS_SH" quote3.tests abc "d e" 3 | fi 4 | 5 | echo 'Testing: in $empty""' 6 | empty='' 7 | for a in $empty""; do echo ".$a."; done 8 | echo Finished 9 | -------------------------------------------------------------------------------- /shell/msh_test/msh-parsing/quote4.right: -------------------------------------------------------------------------------- 1 | a b 2 | -------------------------------------------------------------------------------- /shell/msh_test/msh-parsing/quote4.tests: -------------------------------------------------------------------------------- 1 | a_b='a b' 2 | echo "$a_b" 3 | -------------------------------------------------------------------------------- /shell/msh_test/msh-vars/star.right: -------------------------------------------------------------------------------- 1 | .1. 2 | .abc. 3 | .d. 4 | .e. 5 | .f. 6 | .1 abc d e f. 7 | -------------------------------------------------------------------------------- /shell/msh_test/msh-vars/star.tests: -------------------------------------------------------------------------------- 1 | if test $# = 0; then 2 | exec "$THIS_SH" star.tests 1 abc 'd e f' 3 | fi 4 | # 'd e f' should be split into 3 separate args: 5 | for a in $*; do echo ".$a."; done 6 | 7 | # must produce .1 abc d e f. 8 | for a in "$*"; do echo ".$a."; done 9 | -------------------------------------------------------------------------------- /shell/msh_test/msh-vars/var.right: -------------------------------------------------------------------------------- 1 | http://busybox.net 2 | http://busybox.net_abc 3 | 1 4 | 1 5 | -------------------------------------------------------------------------------- /shell/msh_test/msh-vars/var.tests: -------------------------------------------------------------------------------- 1 | URL=http://busybox.net 2 | 3 | echo $URL 4 | echo ${URL}_abc 5 | 6 | true 7 | false; echo $? 8 | true 9 | { false; echo $?; } 10 | -------------------------------------------------------------------------------- /sysklogd/Kbuild.src: -------------------------------------------------------------------------------- 1 | # Makefile for busybox 2 | # 3 | # Copyright (C) 1999-2005 by Erik Andersen 4 | # 5 | # Licensed under GPLv2, see file LICENSE in this source tree. 6 | 7 | lib-y:= 8 | 9 | INSERT 10 | lib-$(CONFIG_KLOGD) += klogd.o 11 | lib-$(CONFIG_LOGGER) += syslogd_and_logger.o 12 | lib-$(CONFIG_LOGREAD) += logread.o 13 | lib-$(CONFIG_SYSLOGD) += syslogd_and_logger.o 14 | -------------------------------------------------------------------------------- /testsuite/awk_t1.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rovo89/android_external_busybox/bfc653df950d818681510d6004124621bc30240d/testsuite/awk_t1.tar.bz2 -------------------------------------------------------------------------------- /testsuite/basename/basename-does-not-remove-identical-extension: -------------------------------------------------------------------------------- 1 | test xfoo = x`busybox basename foo foo` 2 | -------------------------------------------------------------------------------- /testsuite/basename/basename-works: -------------------------------------------------------------------------------- 1 | test x$(basename $(pwd)) = x$(busybox basename $(pwd)) 2 | -------------------------------------------------------------------------------- /testsuite/bunzip2/bunzip2-reads-from-standard-input: -------------------------------------------------------------------------------- 1 | echo foo | bzip2 | busybox bunzip2 > output 2 | echo foo | cmp - output 3 | -------------------------------------------------------------------------------- /testsuite/bunzip2/bunzip2-removes-compressed-file: -------------------------------------------------------------------------------- 1 | echo foo | bzip2 >foo.bz2 2 | busybox bunzip2 foo.bz2 3 | test ! -f foo.bz2 4 | -------------------------------------------------------------------------------- /testsuite/bunzip2/bzcat-does-not-remove-compressed-file: -------------------------------------------------------------------------------- 1 | echo foo | bzip2 >foo.bz2 2 | busybox bzcat foo.bz2 3 | test -f foo.bz2 4 | -------------------------------------------------------------------------------- /testsuite/cat/cat-prints-a-file: -------------------------------------------------------------------------------- 1 | echo I WANT > foo 2 | busybox cat foo >bar 3 | cmp foo bar 4 | -------------------------------------------------------------------------------- /testsuite/cat/cat-prints-a-file-and-standard-input: -------------------------------------------------------------------------------- 1 | echo I WANT > foo 2 | echo SOMETHING | busybox cat foo - >bar 3 | cat >baz <foo 2 | echo bar >bar 3 | set +e 4 | busybox cmp -s foo bar 5 | if [ $? != 0 ] ; then 6 | exit 0; 7 | fi 8 | 9 | exit 1; 10 | -------------------------------------------------------------------------------- /testsuite/cp/cp-RHL-does_not_preserve-links: -------------------------------------------------------------------------------- 1 | mkdir a 2 | >a/file 3 | ln -s file a/link 4 | busybox cp -RHL a b 5 | test ! -L b/link 6 | #sh /dev/tty 2>&1 7 | -------------------------------------------------------------------------------- /testsuite/cp/cp-a-files-to-dir: -------------------------------------------------------------------------------- 1 | echo file number one > file1 2 | echo file number two > file2 3 | ln -s file2 link1 4 | mkdir dir1 5 | # why??? 6 | #TZ=UTC0 touch -d '2000-01-30 05:24:08' dir1/file3 7 | mkdir there 8 | busybox cp -a file1 file2 link1 dir1 there 9 | test -f there/file1 10 | test -f there/file2 11 | test ! -s there/dir1/file3 12 | test -L there/link1 13 | test xfile2 = x`readlink there/link1` 14 | test ! dir1/file3 -ot there/dir1/file3 15 | test ! dir1/file3 -nt there/dir1/file3 16 | -------------------------------------------------------------------------------- /testsuite/cp/cp-a-preserves-links: -------------------------------------------------------------------------------- 1 | touch foo 2 | ln -s foo bar 3 | busybox cp -a bar baz 4 | test -L baz 5 | test xfoo = x`readlink baz` 6 | -------------------------------------------------------------------------------- /testsuite/cp/cp-copies-empty-file: -------------------------------------------------------------------------------- 1 | touch foo 2 | busybox cp foo bar 3 | cmp foo bar 4 | -------------------------------------------------------------------------------- /testsuite/cp/cp-copies-large-file: -------------------------------------------------------------------------------- 1 | dd if=/dev/zero of=foo seek=10k count=1 2>/dev/null 2 | busybox cp foo bar 3 | cmp foo bar 4 | -------------------------------------------------------------------------------- /testsuite/cp/cp-copies-small-file: -------------------------------------------------------------------------------- 1 | echo I WANT > foo 2 | busybox cp foo bar 3 | cmp foo bar 4 | -------------------------------------------------------------------------------- /testsuite/cp/cp-d-files-to-dir: -------------------------------------------------------------------------------- 1 | echo file number one > file1 2 | echo file number two > file2 3 | touch file3 4 | ln -s file2 link1 5 | mkdir there 6 | busybox cp -d file1 file2 file3 link1 there 7 | test -f there/file1 8 | test -f there/file2 9 | test ! -s there/file3 10 | test -L there/link1 11 | test xfile2 = x`readlink there/link1` 12 | -------------------------------------------------------------------------------- /testsuite/cp/cp-dev-file: -------------------------------------------------------------------------------- 1 | busybox cp /dev/null foo 2 | test -f foo 3 | -------------------------------------------------------------------------------- /testsuite/cp/cp-dir-create-dir: -------------------------------------------------------------------------------- 1 | mkdir bar 2 | touch bar/baz 3 | busybox cp -R bar foo 4 | test -f foo/baz 5 | -------------------------------------------------------------------------------- /testsuite/cp/cp-dir-existing-dir: -------------------------------------------------------------------------------- 1 | mkdir bar 2 | touch bar/baz 3 | mkdir foo 4 | busybox cp -R bar foo 5 | test -f foo/bar/baz 6 | -------------------------------------------------------------------------------- /testsuite/cp/cp-does-not-copy-unreadable-file: -------------------------------------------------------------------------------- 1 | touch foo 2 | chmod a-r foo 3 | set +e 4 | if test `id -u` = 0; then 5 | # run as user with nonzero uid 6 | setuidgid 1 busybox cp foo bar 7 | else 8 | busybox cp foo bar 9 | fi 10 | set -e 11 | test ! -f bar 12 | -------------------------------------------------------------------------------- /testsuite/cp/cp-files-to-dir: -------------------------------------------------------------------------------- 1 | echo file number one > file1 2 | echo file number two > file2 3 | touch file3 4 | ln -s file2 link1 5 | mkdir there 6 | busybox cp file1 file2 file3 link1 there 7 | test -f there/file1 8 | test -f there/file2 9 | test ! -s there/file3 10 | test -f there/link1 11 | cmp there/file2 there/link1 12 | -------------------------------------------------------------------------------- /testsuite/cp/cp-follows-links: -------------------------------------------------------------------------------- 1 | touch foo 2 | ln -s foo bar 3 | busybox cp bar baz 4 | test -f baz 5 | -------------------------------------------------------------------------------- /testsuite/cp/cp-parents: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_CP_LONG_OPTIONS 2 | mkdir -p foo/bar/baz 3 | touch foo/bar/baz/file 4 | mkdir dir 5 | busybox cp --parents foo/bar/baz/file dir 6 | test -f dir/foo/bar/baz/file 7 | -------------------------------------------------------------------------------- /testsuite/cp/cp-preserves-hard-links: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_PRESERVE_HARDLINKS 2 | touch foo 3 | ln foo bar 4 | mkdir baz 5 | busybox cp -d foo bar baz 6 | test baz/foo -ef baz/bar 7 | -------------------------------------------------------------------------------- /testsuite/cp/cp-preserves-links: -------------------------------------------------------------------------------- 1 | touch foo 2 | ln -s foo bar 3 | busybox cp -d bar baz 4 | test -L baz 5 | test xfoo = x`readlink baz` 6 | -------------------------------------------------------------------------------- /testsuite/cp/cp-preserves-source-file: -------------------------------------------------------------------------------- 1 | touch foo 2 | busybox cp foo bar 3 | test -f foo 4 | -------------------------------------------------------------------------------- /testsuite/cut/cut-cuts-a-character: -------------------------------------------------------------------------------- 1 | test $(echo abcd | busybox cut -c 3) = c 2 | -------------------------------------------------------------------------------- /testsuite/cut/cut-cuts-a-closed-range: -------------------------------------------------------------------------------- 1 | test $(echo abcd | busybox cut -c 1-2) = ab 2 | -------------------------------------------------------------------------------- /testsuite/cut/cut-cuts-a-field: -------------------------------------------------------------------------------- 1 | test $($ECHO -e "f1\tf2\tf3" | busybox cut -f 2) = f2 2 | -------------------------------------------------------------------------------- /testsuite/cut/cut-cuts-an-open-range: -------------------------------------------------------------------------------- 1 | test $(echo abcd | busybox cut -c -3) = abc 2 | -------------------------------------------------------------------------------- /testsuite/cut/cut-cuts-an-unclosed-range: -------------------------------------------------------------------------------- 1 | test $(echo abcd | busybox cut -c 3-) = cd 2 | -------------------------------------------------------------------------------- /testsuite/date/date-format-works: -------------------------------------------------------------------------------- 1 | # TODO: gnu date doesn't accept '2000.11.22-11:22:33' format, 2 | # but accepts '2000-11-22 11:22:33'. We must follow. 3 | test x"01/01/99" = x"`busybox date -d 1999.01.01-11:22:33 '+%d/%m/%y'`" 4 | test x"22/11/00" = x"`busybox date -d 2000.11.22-11:22:33 '+%d/%m/%y'`" 5 | -------------------------------------------------------------------------------- /testsuite/date/date-u-works: -------------------------------------------------------------------------------- 1 | test x"Sat Jan 1 11:22:33 UTC 2000" = x"`TZ=CET-1CEST-2 busybox date -u -d 2000.01.01-11:22:33`" 2 | -------------------------------------------------------------------------------- /testsuite/dd/dd-accepts-if: -------------------------------------------------------------------------------- 1 | echo I WANT >foo 2 | test "$(busybox dd if=foo 2>/dev/null)" = "I WANT" 3 | -------------------------------------------------------------------------------- /testsuite/dd/dd-accepts-of: -------------------------------------------------------------------------------- 1 | echo I WANT | busybox dd of=foo 2>/dev/null 2 | echo I WANT | cmp foo - 3 | -------------------------------------------------------------------------------- /testsuite/dd/dd-copies-from-standard-input-to-standard-output: -------------------------------------------------------------------------------- 1 | test "$(echo I WANT | busybox dd 2>/dev/null)" = "I WANT" 2 | -------------------------------------------------------------------------------- /testsuite/dd/dd-prints-count-to-standard-error: -------------------------------------------------------------------------------- 1 | echo I WANT | busybox dd of=foo >/dev/null 2>bar 2 | grep -q records bar 3 | -------------------------------------------------------------------------------- /testsuite/dd/dd-reports-write-errors: -------------------------------------------------------------------------------- 1 | busybox dd if="$0" of=/dev/full 2>/dev/null || status=$? 2 | test $status = 1 3 | -------------------------------------------------------------------------------- /testsuite/dirname/dirname-handles-absolute-path: -------------------------------------------------------------------------------- 1 | test $(busybox dirname /foo/bar/baz) = /foo/bar 2 | -------------------------------------------------------------------------------- /testsuite/dirname/dirname-handles-empty-path: -------------------------------------------------------------------------------- 1 | test $(busybox dirname '') = . 2 | -------------------------------------------------------------------------------- /testsuite/dirname/dirname-handles-multiple-slashes: -------------------------------------------------------------------------------- 1 | test $(busybox dirname foo/bar///baz) = foo/bar 2 | -------------------------------------------------------------------------------- /testsuite/dirname/dirname-handles-relative-path: -------------------------------------------------------------------------------- 1 | test $(busybox dirname foo/bar/baz) = foo/bar 2 | -------------------------------------------------------------------------------- /testsuite/dirname/dirname-handles-root: -------------------------------------------------------------------------------- 1 | test $(busybox dirname /) = / 2 | -------------------------------------------------------------------------------- /testsuite/dirname/dirname-handles-single-component: -------------------------------------------------------------------------------- 1 | test $(busybox dirname foo) = . 2 | -------------------------------------------------------------------------------- /testsuite/dirname/dirname-works: -------------------------------------------------------------------------------- 1 | test x$(dirname $(pwd)) = x$(busybox dirname $(pwd)) 2 | -------------------------------------------------------------------------------- /testsuite/du/du-h-works: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_HUMAN_READABLE 2 | 3 | dd if=/dev/zero of=file bs=1M count=1 2>/dev/null 4 | test x"`busybox du -h file`" = x"1.0M file" 5 | -------------------------------------------------------------------------------- /testsuite/du/du-l-works: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K 2 | 3 | mkdir du.testdir 4 | cd du.testdir 5 | dd if=/dev/zero of=file1 bs=1k count=64 2>/dev/null 6 | ln file1 file1.1 7 | dd if=/dev/zero of=file2 bs=1k count=16 2>/dev/null 8 | test x"`busybox du -l .`" = x"144 ." \ 9 | -o x"`busybox du -l .`" = x"146 ." \ 10 | -o x"`busybox du -l .`" = x"148 ." \ 11 | -o x"`busybox du -l .`" = x"152 ." \ 12 | -o x"`busybox du -l .`" = x"156 ." 13 | -------------------------------------------------------------------------------- /testsuite/du/du-m-works: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_HUMAN_READABLE 2 | 3 | dd if=/dev/zero of=file bs=1M count=1 2>/dev/null 4 | test x"`busybox du -m .`" = x"1 ." 5 | -------------------------------------------------------------------------------- /testsuite/du/du-s-works: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K 2 | 3 | d=/system/bin 4 | du -s "$d" > logfile.gnu 5 | busybox du -s "$d" > logfile.bb 6 | cmp logfile.gnu logfile.bb && exit 0 7 | diff -u logfile.gnu logfile.bb 8 | exit 1 9 | -------------------------------------------------------------------------------- /testsuite/du/du-works: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K 2 | 3 | d=/system/bin 4 | du "$d" > logfile.gnu 5 | busybox du "$d" > logfile.bb 6 | cmp logfile.gnu logfile.bb && exit 0 7 | diff -u logfile.gnu logfile.bb 8 | exit 1 9 | -------------------------------------------------------------------------------- /testsuite/echo/echo-does-not-print-newline: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_FANCY_ECHO 2 | 3 | test `busybox echo -n word | wc -c` -eq 4 4 | -------------------------------------------------------------------------------- /testsuite/echo/echo-prints-argument: -------------------------------------------------------------------------------- 1 | test xfubar = x`busybox echo fubar` 2 | -------------------------------------------------------------------------------- /testsuite/echo/echo-prints-arguments: -------------------------------------------------------------------------------- 1 | test "`busybox echo foo bar`" = "foo bar" 2 | -------------------------------------------------------------------------------- /testsuite/echo/echo-prints-dash: -------------------------------------------------------------------------------- 1 | test "`busybox echo - | od -t x1 | head -n 1`" = "0000000 2d 0a" 2 | -------------------------------------------------------------------------------- /testsuite/echo/echo-prints-newline: -------------------------------------------------------------------------------- 1 | test `busybox echo word | wc -c` -eq 5 2 | -------------------------------------------------------------------------------- /testsuite/echo/echo-prints-non-opts: -------------------------------------------------------------------------------- 1 | test "`busybox echo -neEZ | od -t x1 | head -n 1`" = "0000000 2d 6e 65 45 5a 0a" 2 | -------------------------------------------------------------------------------- /testsuite/echo/echo-prints-slash-zero: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_FANCY_ECHO 2 | 3 | test "`busybox echo -e -n 'msg\n\0' | od -t x1 | head -n 1`" = "0000000 6d 73 67 0a 00" 4 | -------------------------------------------------------------------------------- /testsuite/echo/echo-prints-slash_00041: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_FANCY_ECHO 2 | 3 | test "`busybox echo -ne '\00041z' | od -t x1 | head -n 1`" = "0000000 04 31 7a" 4 | -------------------------------------------------------------------------------- /testsuite/echo/echo-prints-slash_0041: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_FANCY_ECHO 2 | 3 | test "`busybox echo -ne '\0041z' | od -t x1 | head -n 1`" = "0000000 21 7a" 4 | -------------------------------------------------------------------------------- /testsuite/echo/echo-prints-slash_041: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_FANCY_ECHO 2 | 3 | test "`busybox echo -ne '\041z' | od -t x1 | head -n 1`" = "0000000 21 7a" 4 | -------------------------------------------------------------------------------- /testsuite/echo/echo-prints-slash_41: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_FANCY_ECHO 2 | 3 | test "`busybox echo -ne '\41z' | od -t x1 | head -n 1`" = "0000000 21 7a" 4 | -------------------------------------------------------------------------------- /testsuite/false/false-is-silent: -------------------------------------------------------------------------------- 1 | busybox false 2>&1 | cmp - /dev/null 2 | -------------------------------------------------------------------------------- /testsuite/false/false-returns-failure: -------------------------------------------------------------------------------- 1 | ! busybox false 2 | -------------------------------------------------------------------------------- /testsuite/find/find-supports-minus-xdev: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_FIND_XDEV 2 | 3 | busybox find . -xdev >/dev/null 2>&1 4 | -------------------------------------------------------------------------------- /testsuite/gunzip.tests: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ./bunzip2.tests 4 | -------------------------------------------------------------------------------- /testsuite/gunzip/gunzip-reads-from-standard-input: -------------------------------------------------------------------------------- 1 | echo foo | gzip | busybox gunzip > output 2 | echo foo | cmp - output 3 | -------------------------------------------------------------------------------- /testsuite/gzip/gzip-accepts-multiple-files: -------------------------------------------------------------------------------- 1 | touch foo bar 2 | busybox gzip foo bar 3 | test -f foo.gz -a -f bar.gz 4 | -------------------------------------------------------------------------------- /testsuite/gzip/gzip-accepts-single-minus: -------------------------------------------------------------------------------- 1 | echo foo | busybox gzip - >/dev/null 2 | -------------------------------------------------------------------------------- /testsuite/gzip/gzip-removes-original-file: -------------------------------------------------------------------------------- 1 | touch foo 2 | busybox gzip foo 3 | test ! -f foo 4 | -------------------------------------------------------------------------------- /testsuite/head/head-n-works: -------------------------------------------------------------------------------- 1 | [ -n "$d" ] || d=.. 2 | head -n 2 "$d/README" > logfile.gnu 3 | busybox head -n 2 "$d/README" > logfile.bb 4 | cmp logfile.gnu logfile.bb 5 | -------------------------------------------------------------------------------- /testsuite/head/head-works: -------------------------------------------------------------------------------- 1 | [ -n "$d" ] || d=.. 2 | head "$d/README" > logfile.gnu 3 | busybox head "$d/README" > logfile.bb 4 | cmp logfile.gnu logfile.bb 5 | -------------------------------------------------------------------------------- /testsuite/hostid/hostid-works: -------------------------------------------------------------------------------- 1 | h=x$(busybox hostid) 2 | # Is $h a sequence of hex numbers? 3 | case "$h" in 4 | x*[!0-9a-f]*) false;; 5 | *) true;; 6 | esac 7 | -------------------------------------------------------------------------------- /testsuite/hostname/hostname-d-works: -------------------------------------------------------------------------------- 1 | f=$(busybox hostname -f). 2 | d=$(busybox hostname -d) 3 | test x"${f#*.}" = x"$d${d:+.}" 4 | -------------------------------------------------------------------------------- /testsuite/hostname/hostname-i-works: -------------------------------------------------------------------------------- 1 | test x"$SKIP_KNOWN_BUGS" != x"" && exit 2 | 3 | # Observed bug: 4 | # # ./busybox hostname -i 5 | # 127.0.0.1 6 | # # hostname -i 7 | # 127.0.0.1 10.0.0.2 10.32.10.45 8 | 9 | test x$(hostname -i) = x$(busybox hostname -i) 10 | -------------------------------------------------------------------------------- /testsuite/hostname/hostname-s-works: -------------------------------------------------------------------------------- 1 | test x$(hostname -s) = x$(busybox hostname -s) 2 | -------------------------------------------------------------------------------- /testsuite/hostname/hostname-works: -------------------------------------------------------------------------------- 1 | test x$(hostname) = x$(busybox hostname) 2 | -------------------------------------------------------------------------------- /testsuite/id/id-g-works: -------------------------------------------------------------------------------- 1 | test x$(id -g) = x$(busybox id -g) 2 | -------------------------------------------------------------------------------- /testsuite/id/id-u-works: -------------------------------------------------------------------------------- 1 | test x$(id -u) = x$(busybox id -u) 2 | -------------------------------------------------------------------------------- /testsuite/id/id-un-works: -------------------------------------------------------------------------------- 1 | test x$(id -un) = x$(busybox id -un) 2 | -------------------------------------------------------------------------------- /testsuite/id/id-ur-works: -------------------------------------------------------------------------------- 1 | test x$(id -ur) = x$(busybox id -ur) 2 | -------------------------------------------------------------------------------- /testsuite/ln/ln-creates-hard-links: -------------------------------------------------------------------------------- 1 | echo file number one > file1 2 | busybox ln file1 link1 3 | test -f file1 4 | test -f link1 5 | -------------------------------------------------------------------------------- /testsuite/ln/ln-creates-soft-links: -------------------------------------------------------------------------------- 1 | echo file number one > file1 2 | busybox ln -s file1 link1 3 | test -L link1 4 | test xfile1 = x`readlink link1` 5 | -------------------------------------------------------------------------------- /testsuite/ln/ln-force-creates-hard-links: -------------------------------------------------------------------------------- 1 | echo file number one > file1 2 | echo file number two > link1 3 | busybox ln -f file1 link1 4 | test -f file1 5 | test -f link1 6 | -------------------------------------------------------------------------------- /testsuite/ln/ln-force-creates-soft-links: -------------------------------------------------------------------------------- 1 | echo file number one > file1 2 | echo file number two > link1 3 | busybox ln -f -s file1 link1 4 | test -L link1 5 | test xfile1 = x`readlink link1` 6 | -------------------------------------------------------------------------------- /testsuite/ln/ln-preserves-hard-links: -------------------------------------------------------------------------------- 1 | echo file number one > file1 2 | echo file number two > link1 3 | set +e 4 | busybox ln file1 link1 5 | if [ $? != 0 ] ; then 6 | exit 0; 7 | fi 8 | exit 1; 9 | -------------------------------------------------------------------------------- /testsuite/ln/ln-preserves-soft-links: -------------------------------------------------------------------------------- 1 | echo file number one > file1 2 | echo file number two > link1 3 | set +e 4 | busybox ln -s file1 link1 5 | if [ $? != 0 ] ; then 6 | exit 0; 7 | fi 8 | exit 1; 9 | -------------------------------------------------------------------------------- /testsuite/ls.mk_uni_tests: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rovo89/android_external_busybox/bfc653df950d818681510d6004124621bc30240d/testsuite/ls.mk_uni_tests -------------------------------------------------------------------------------- /testsuite/ls/ls-1-works: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_LS_SORTFILES 2 | 3 | [ -n "$d" ] || d=.. 4 | LC_ALL=C ls -1 "$d" > logfile.gnu 5 | LC_ALL=C busybox ls -1 "$d" > logfile.bb 6 | diff -ubw logfile.gnu logfile.bb 7 | -------------------------------------------------------------------------------- /testsuite/ls/ls-h-works: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_LS_SORTFILES CONFIG_FEATURE_HUMAN_READABLE 2 | 3 | [ -n "$d" ] || d=.. 4 | LC_ALL=C ls -h "$d" > logfile.gnu 5 | LC_ALL=C busybox ls -h "$d" > logfile.bb 6 | diff -ubw logfile.gnu logfile.bb 7 | -------------------------------------------------------------------------------- /testsuite/ls/ls-l-works: -------------------------------------------------------------------------------- 1 | test x"$SKIP_KNOWN_BUGS" != x"" && exit 2 | 3 | # busybox does not emit "total NNN" line 4 | 5 | [ -n "$d" ] || d=.. 6 | LC_ALL=C ls -l "$d" > logfile.gnu 7 | LC_ALL=C busybox ls -l "$d" > logfile.bb 8 | diff -ubw logfile.gnu logfile.bb 9 | -------------------------------------------------------------------------------- /testsuite/ls/ls-s-works: -------------------------------------------------------------------------------- 1 | test x"$SKIP_KNOWN_BUGS" != x"" && exit 2 | 3 | # busybox does not emit "total NNN" line 4 | 5 | [ -n "$d" ] || d=.. 6 | LC_ALL=C ls -1s "$d" > logfile.gnu 7 | LC_ALL=C busybox ls -1s "$d" > logfile.bb 8 | diff -ubw logfile.gnu logfile.bb 9 | -------------------------------------------------------------------------------- /testsuite/md5sum/md5sum-verifies-non-binary-file: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_MD5_SHA1_SUM_CHECK 2 | 3 | touch foo 4 | md5sum foo > bar 5 | busybox md5sum -c bar 6 | -------------------------------------------------------------------------------- /testsuite/mkdir/mkdir-makes-a-directory: -------------------------------------------------------------------------------- 1 | busybox mkdir foo 2 | test -d foo 3 | -------------------------------------------------------------------------------- /testsuite/mkdir/mkdir-makes-parent-directories: -------------------------------------------------------------------------------- 1 | busybox mkdir -p foo/bar 2 | test -d foo -a -d foo/bar 3 | -------------------------------------------------------------------------------- /testsuite/msh/msh-supports-underscores-in-variable-names: -------------------------------------------------------------------------------- 1 | test "`busybox msh -c 'FOO_BAR=foo; echo $FOO_BAR'`" = foo 2 | -------------------------------------------------------------------------------- /testsuite/mv/mv-files-to-dir: -------------------------------------------------------------------------------- 1 | echo file number one > file1 2 | echo file number two > file2 3 | ln -s file2 link1 4 | mkdir dir1 5 | TZ=UTC0 touch -d '2000-01-30 05:24:08' dir1/file3 6 | mkdir there 7 | busybox mv file1 file2 link1 dir1 there 8 | test -f there/file1 9 | test -f there/file2 10 | test -f there/dir1/file3 11 | test -L there/link1 12 | test xfile2 = x`readlink there/link1` 13 | test ! -e file1 14 | test ! -e file2 15 | test ! -e link1 16 | test ! -e dir1/file3 17 | -------------------------------------------------------------------------------- /testsuite/mv/mv-follows-links: -------------------------------------------------------------------------------- 1 | touch foo 2 | ln -s foo bar 3 | busybox mv bar baz 4 | test -f baz 5 | -------------------------------------------------------------------------------- /testsuite/mv/mv-moves-empty-file: -------------------------------------------------------------------------------- 1 | touch foo 2 | busybox mv foo bar 3 | test ! -e foo 4 | test -f bar 5 | -------------------------------------------------------------------------------- /testsuite/mv/mv-moves-file: -------------------------------------------------------------------------------- 1 | touch foo 2 | busybox mv foo bar 3 | test ! -f foo -a -f bar 4 | -------------------------------------------------------------------------------- /testsuite/mv/mv-moves-hardlinks: -------------------------------------------------------------------------------- 1 | touch foo 2 | ln foo bar 3 | busybox mv bar baz 4 | test ! -f bar -a -f baz 5 | -------------------------------------------------------------------------------- /testsuite/mv/mv-moves-large-file: -------------------------------------------------------------------------------- 1 | dd if=/dev/zero of=foo seek=10k count=1 2>/dev/null 2 | busybox mv foo bar 3 | test ! -e foo 4 | test -f bar 5 | -------------------------------------------------------------------------------- /testsuite/mv/mv-moves-small-file: -------------------------------------------------------------------------------- 1 | echo I WANT > foo 2 | busybox mv foo bar 3 | test ! -e foo 4 | test -f bar 5 | -------------------------------------------------------------------------------- /testsuite/mv/mv-moves-symlinks: -------------------------------------------------------------------------------- 1 | touch foo 2 | ln -s foo bar 3 | busybox mv bar baz 4 | test -f foo 5 | test ! -e bar 6 | test -L baz 7 | -------------------------------------------------------------------------------- /testsuite/mv/mv-moves-unreadable-files: -------------------------------------------------------------------------------- 1 | touch foo 2 | chmod a-r foo 3 | busybox mv foo bar 4 | test ! -e foo 5 | test -f bar 6 | -------------------------------------------------------------------------------- /testsuite/mv/mv-preserves-hard-links: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_PRESERVE_HARDLINKS 2 | touch foo 3 | ln foo bar 4 | mkdir baz 5 | busybox mv foo bar baz 6 | test baz/foo -ef baz/bar 7 | -------------------------------------------------------------------------------- /testsuite/mv/mv-preserves-links: -------------------------------------------------------------------------------- 1 | touch foo 2 | ln -s foo bar 3 | busybox mv bar baz 4 | test -L baz 5 | test xfoo = x`readlink baz` 6 | -------------------------------------------------------------------------------- /testsuite/mv/mv-removes-source-file: -------------------------------------------------------------------------------- 1 | touch foo 2 | busybox mv foo bar 3 | test ! -e foo 4 | test -f bar 5 | -------------------------------------------------------------------------------- /testsuite/pwd/pwd-prints-working-directory: -------------------------------------------------------------------------------- 1 | test $(pwd) = $(busybox pwd) 2 | -------------------------------------------------------------------------------- /testsuite/rm/rm-removes-file: -------------------------------------------------------------------------------- 1 | touch foo 2 | busybox rm foo 3 | test ! -f foo 4 | -------------------------------------------------------------------------------- /testsuite/rmdir/rmdir-removes-parent-directories: -------------------------------------------------------------------------------- 1 | mkdir -p foo/bar 2 | busybox rmdir -p foo/bar 3 | test ! -d foo 4 | -------------------------------------------------------------------------------- /testsuite/sha1sum.tests: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ./md5sum.tests sha1sum d41337e834377140ae7f98460d71d908598ef04f 4 | -------------------------------------------------------------------------------- /testsuite/sha256sum.tests: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ./md5sum.tests sha256sum 8e1d3ed57ebc130f0f72508446559eeae06451ae6d61b1e8ce46370cfb8963c3 4 | -------------------------------------------------------------------------------- /testsuite/sha3sum.tests: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ./md5sum.tests sha3sum c29d77bc548fa2b20a04c861400a5360879c52156e2a54a3415b99a9a3123e1d5f36714a24eca8c1f05a8e2d8ba859c930d41141f64a255c6794436fc99c486a 4 | -------------------------------------------------------------------------------- /testsuite/sha512sum.tests: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ./md5sum.tests sha512sum fe413e0f177324d1353893ca0772ceba83fd41512ba63895a0eebb703ef9feac2fb4e92b2cb430b3bda41b46b0cb4ea8307190a5cc795157cfb680a9cd635d0f 4 | -------------------------------------------------------------------------------- /testsuite/strings/strings-works-like-GNU: -------------------------------------------------------------------------------- 1 | rm -f foo bar 2 | strings -af ../../busybox > foo 3 | busybox strings -af ../../busybox > bar 4 | set +e 5 | test ! -f foo -a -f bar 6 | if [ $? = 0 ] ; then 7 | set -e 8 | diff -q foo bar 9 | fi 10 | -------------------------------------------------------------------------------- /testsuite/tail/tail-n-works: -------------------------------------------------------------------------------- 1 | $ECHO -ne "abc\ndef\n123\n" >input 2 | $ECHO -ne "def\n123\n" >logfile.ok 3 | busybox tail -n 2 input > logfile.bb 4 | cmp logfile.ok logfile.bb 5 | -------------------------------------------------------------------------------- /testsuite/tail/tail-works: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_INCLUDE_SUSv2 2 | 3 | $ECHO -ne "abc\ndef\n123\n" >input 4 | $ECHO -ne "def\n123\n" >logfile.ok 5 | busybox tail -2 input > logfile.bb 6 | cmp logfile.ok logfile.bb 7 | -------------------------------------------------------------------------------- /testsuite/tar/tar-archives-multiple-files: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_TAR_CREATE 2 | touch foo bar 3 | busybox tar cf foo.tar foo bar 4 | rm foo bar 5 | tar xf foo.tar 6 | test -f foo -a -f bar 7 | -------------------------------------------------------------------------------- /testsuite/tar/tar-complains-about-missing-file: -------------------------------------------------------------------------------- 1 | touch foo 2 | tar cf foo.tar foo 3 | ! busybox tar xf foo.tar bar 4 | -------------------------------------------------------------------------------- /testsuite/tar/tar-demands-at-least-one-ctx: -------------------------------------------------------------------------------- 1 | ! busybox tar v 2 | -------------------------------------------------------------------------------- /testsuite/tar/tar-demands-at-most-one-ctx: -------------------------------------------------------------------------------- 1 | ! busybox tar tx 2 | -------------------------------------------------------------------------------- /testsuite/tar/tar-extracts-all-subdirs: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_TAR_CREATE 2 | mkdir -p foo/{1,2,3} 3 | mkdir -p foo/1/{10,11} 4 | mkdir -p foo/1/10/{100,101,102} 5 | tar cf foo.tar -C foo . 6 | rm -rf foo/* 7 | busybox tar xf foo.tar -C foo ./1/10 8 | find foo | sort >logfile.bb 9 | rm -rf foo/* 10 | tar xf foo.tar -C foo ./1/10 11 | find foo | sort >logfile.gnu 12 | diff -u logfile.gnu logfile.bb 13 | -------------------------------------------------------------------------------- /testsuite/tar/tar-extracts-file: -------------------------------------------------------------------------------- 1 | touch foo 2 | tar cf foo.tar foo 3 | rm foo 4 | busybox tar xf foo.tar 5 | test -f foo 6 | -------------------------------------------------------------------------------- /testsuite/tar/tar-extracts-from-standard-input: -------------------------------------------------------------------------------- 1 | touch foo 2 | tar cf foo.tar foo 3 | rm foo 4 | cat foo.tar | busybox tar x 5 | test -f foo 6 | -------------------------------------------------------------------------------- /testsuite/tar/tar-extracts-multiple-files: -------------------------------------------------------------------------------- 1 | touch foo bar 2 | tar cf foo.tar foo bar 3 | rm foo bar 4 | busybox tar -xf foo.tar 5 | test -f foo 6 | test -f bar 7 | -------------------------------------------------------------------------------- /testsuite/tar/tar-extracts-to-standard-output: -------------------------------------------------------------------------------- 1 | echo foo > foo 2 | tar cf foo.tar foo 3 | cat foo.tar | busybox tar Ox | cmp foo - 4 | -------------------------------------------------------------------------------- /testsuite/tar/tar-handles-cz-options: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_TAR_CREATE 2 | # FEATURE: CONFIG_FEATURE_SEAMLESS_GZ 3 | touch foo 4 | busybox tar czf foo.tar.gz foo 5 | gzip -d foo.tar.gz 6 | -------------------------------------------------------------------------------- /testsuite/tar/tar-handles-empty-include-and-non-empty-exclude-list: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_TAR_FROM 2 | # FEATURE: CONFIG_FEATURE_TAR_CREATE 3 | touch foo 4 | tar cf foo.tar foo 5 | echo foo >foo.exclude 6 | busybox tar xf foo.tar -X foo.exclude 7 | -------------------------------------------------------------------------------- /testsuite/tar/tar-handles-exclude-and-extract-lists: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_TAR_FROM 2 | # FEATURE: CONFIG_FEATURE_TAR_CREATE 3 | touch foo bar baz 4 | tar cf foo.tar foo bar baz 5 | echo foo >foo.exclude 6 | rm foo bar baz 7 | busybox tar xf foo.tar foo bar -X foo.exclude 8 | test ! -f foo -a -f bar -a ! -f baz 9 | -------------------------------------------------------------------------------- /testsuite/tar/tar-handles-multiple-X-options: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_TAR_FROM 2 | # FEATURE: CONFIG_FEATURE_TAR_CREATE 3 | touch foo 4 | touch bar 5 | tar cf foo.tar foo bar 6 | echo foo > foo.exclude 7 | echo bar > bar.exclude 8 | rm foo bar 9 | busybox tar xf foo.tar -X foo.exclude -X bar.exclude 10 | test ! -f foo -a ! -f bar 11 | -------------------------------------------------------------------------------- /testsuite/tar/tar-handles-nested-exclude: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_TAR_FROM 2 | # FEATURE: CONFIG_FEATURE_TAR_CREATE 3 | mkdir foo 4 | touch foo/bar 5 | tar cf foo.tar foo 6 | rm -rf foo 7 | echo foo/bar >foobar.exclude 8 | busybox tar xf foo.tar foo -X foobar.exclude 9 | test -d foo -a ! -f foo/bar 10 | -------------------------------------------------------------------------------- /testsuite/tee/tee-appends-input: -------------------------------------------------------------------------------- 1 | echo i\'m a little teapot >foo 2 | cp foo bar 3 | echo i\'m a little teapot >>foo 4 | echo i\'m a little teapot | busybox tee -a bar >/dev/null 5 | cmp foo bar 6 | -------------------------------------------------------------------------------- /testsuite/tee/tee-tees-input: -------------------------------------------------------------------------------- 1 | echo i\'m a little teapot >foo 2 | echo i\'m a little teapot | busybox tee bar >baz 3 | cmp foo bar && cmp foo baz 4 | -------------------------------------------------------------------------------- /testsuite/touch/touch-creates-file: -------------------------------------------------------------------------------- 1 | busybox touch foo 2 | test -f foo 3 | -------------------------------------------------------------------------------- /testsuite/touch/touch-does-not-create-file: -------------------------------------------------------------------------------- 1 | busybox touch -c foo 2 | test ! -f foo 3 | -------------------------------------------------------------------------------- /testsuite/touch/touch-touches-files-after-non-existent-file: -------------------------------------------------------------------------------- 1 | touch -t 198001010000 bar 2 | busybox touch -c foo bar 3 | test x"`find bar -mtime -1`" = xbar 4 | -------------------------------------------------------------------------------- /testsuite/tr/tr-d-alnum-works: -------------------------------------------------------------------------------- 1 | # FEATURE: CONFIG_FEATURE_TR_CLASSES 2 | 3 | echo testing | tr -d '[[:alnum:]]' > logfile.gnu 4 | echo testing | busybox tr -d '[[:alnum:]]' > logfile.bb 5 | 6 | diff -u logfile.gnu logfile.bb 7 | -------------------------------------------------------------------------------- /testsuite/tr/tr-d-works: -------------------------------------------------------------------------------- 1 | echo testing | tr -d aeiou > logfile.gnu 2 | echo testing | busybox tr -d aeiou > logfile.bb 3 | 4 | diff -u logfile.gnu logfile.bb 5 | -------------------------------------------------------------------------------- /testsuite/tr/tr-non-gnu: -------------------------------------------------------------------------------- 1 | echo fdhrnzvfu bffvsentr | busybox tr '[a-z]' '[n-z][a-m]' 2 | -------------------------------------------------------------------------------- /testsuite/true/true-is-silent: -------------------------------------------------------------------------------- 1 | busybox true 2>&1 | cmp - /dev/null 2 | -------------------------------------------------------------------------------- /testsuite/true/true-returns-success: -------------------------------------------------------------------------------- 1 | busybox true 2 | -------------------------------------------------------------------------------- /testsuite/umlwrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Wrapper for User Mode Linux emulation environment 4 | 5 | RUNFILE="$(pwd)/${1}.testroot" 6 | if [ -z "$RUNFILE" ] || [ ! -x "$RUNFILE" ] 7 | then 8 | echo "Can't run '$RUNFILE'" 9 | exit 1 10 | fi 11 | 12 | shift 13 | 14 | if [ -z $(which linux) ] 15 | then 16 | echo "No User Mode Linux." 17 | exit 1; 18 | fi 19 | 20 | linux rootfstype=hostfs rw init="$RUNFILE" TESTDIR=`pwd` PATH="$PATH" $* quiet 21 | -------------------------------------------------------------------------------- /testsuite/uptime/uptime-works: -------------------------------------------------------------------------------- 1 | busybox uptime 2 | -------------------------------------------------------------------------------- /testsuite/wc/wc-counts-all: -------------------------------------------------------------------------------- 1 | # 1 line, 4 words, 20 chars. 2 | test "`echo i\'m a little teapot | busybox wc | sed 's/ */ /g' | sed 's/^ //'`" = '1 4 20' 3 | -------------------------------------------------------------------------------- /testsuite/wc/wc-counts-characters: -------------------------------------------------------------------------------- 1 | test `echo i\'m a little teapot | busybox wc -c` -eq 20 2 | -------------------------------------------------------------------------------- /testsuite/wc/wc-counts-lines: -------------------------------------------------------------------------------- 1 | test `echo i\'m a little teapot | busybox wc -l` -eq 1 2 | -------------------------------------------------------------------------------- /testsuite/wc/wc-counts-words: -------------------------------------------------------------------------------- 1 | test `echo i\'m a little teapot | busybox wc -w` -eq 4 2 | -------------------------------------------------------------------------------- /testsuite/wc/wc-prints-longest-line-length: -------------------------------------------------------------------------------- 1 | test `echo i\'m a little teapot | busybox wc -L` -eq 19 2 | -------------------------------------------------------------------------------- /testsuite/wget/wget--O-overrides--P: -------------------------------------------------------------------------------- 1 | test x"$SKIP_INTERNET_TESTS" != x"" && exit 2 | 3 | mkdir foo 4 | busybox wget -q -O index.html -P foo http://www.google.com/ 5 | test -s index.html 6 | -------------------------------------------------------------------------------- /testsuite/wget/wget-handles-empty-path: -------------------------------------------------------------------------------- 1 | test x"$SKIP_INTERNET_TESTS" != x"" && exit 2 | 3 | busybox wget http://www.google.com 4 | -------------------------------------------------------------------------------- /testsuite/wget/wget-retrieves-google-index: -------------------------------------------------------------------------------- 1 | test x"$SKIP_INTERNET_TESTS" != x"" && exit 2 | 3 | busybox wget -q -O foo http://www.google.com/ 4 | test -s foo 5 | -------------------------------------------------------------------------------- /testsuite/wget/wget-supports--P: -------------------------------------------------------------------------------- 1 | test x"$SKIP_INTERNET_TESTS" != x"" && exit 2 | 3 | mkdir foo 4 | busybox wget -q -P foo http://www.google.com/ 5 | test -s foo/index.html 6 | -------------------------------------------------------------------------------- /testsuite/which/which-uses-default-path: -------------------------------------------------------------------------------- 1 | BUSYBOX=$(command -pv busybox) 2 | SAVED_PATH=$PATH 3 | unset PATH 4 | $BUSYBOX which ls 5 | -------------------------------------------------------------------------------- /testsuite/xargs/xargs-works: -------------------------------------------------------------------------------- 1 | [ -n "$d" ] || d=.. 2 | find "$d" -name \*works -type f | xargs md5sum > logfile.gnu 3 | find "$d" -name \*works -type f | busybox xargs md5sum > logfile.bb 4 | diff -u logfile.gnu logfile.bb 5 | -------------------------------------------------------------------------------- /util-linux/volume_id/Config.src: -------------------------------------------------------------------------------- 1 | # 2 | # For a description of the syntax of this configuration file, 3 | # see scripts/kbuild/config-language.txt. 4 | # 5 | 6 | config VOLUMEID 7 | bool #No description makes it a hidden option 8 | default n 9 | 10 | menu "Filesystem/Volume identification" 11 | depends on VOLUMEID 12 | 13 | INSERT 14 | 15 | endmenu 16 | -------------------------------------------------------------------------------- /util-linux/volume_id/Kbuild.src: -------------------------------------------------------------------------------- 1 | # Makefile for busybox 2 | # 3 | # Copyright (C) 1999-2005 by Erik Andersen 4 | # 5 | # Licensed under GPLv2, see file LICENSE in this source tree. 6 | 7 | lib-y:= 8 | 9 | INSERT 10 | --------------------------------------------------------------------------------