aboutsummaryrefslogtreecommitdiff
path: root/shell
AgeCommit message (Collapse)Author
2014-09-08ash: factor out ASH_HELP config optionDenys Vlasenko
It used to be aliased to !FEATURE_SH_EXTRA_QUIET for ash, while hush had it separate from FEATURE_SH_EXTRA_QUIET. Bring ash in line with hush. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-08-13ash: make ${#var} unicode-awareDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-08-13ash,hush: run reinit_unicode() only if makes senseDenys Vlasenko
With static Unicode support, no need to check $LANG et al. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-08-13hush: make ${#var} unicode-awareDenys Vlasenko
This mimics bash Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-06-22libbb: use a wrapper around sysconf(_SC_CLK_TCK) to save a few bytesBartosz Golaszewski
function old new delta bb_sc_clk_tck - 10 +10 timescmd 118 113 -5 print_route 1763 1758 -5 mpstat_main 1288 1283 -5 iostat_main 1947 1942 -5 INET_setroute 879 871 -8 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/5 up/down: 10/-28) Total: -18 bytes Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-04-15ash,hush: set $HOSTNAME is bash compat. Closes 7028Denys Vlasenko
function old new delta hush_main 1056 1128 +72 ash_main 1442 1487 +45 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-16ash: make "locak VAR" unset VAR (bash does that)Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-15ash,hush: fix a thinko about 2^64-1 factorizationDenys Vlasenko
function old new delta next_random 113 119 +6 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-14hush: make "true" built-inDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-13random: cosmetic tweaks in debug codeDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-13ash,hush: improve randomness of $RANDOM, add easy-ish way to test itDenys Vlasenko
function old new delta next_random 68 113 +45 change_random 103 121 +18 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-07ash: in bash compat mode, always export $SHLVLDenys Vlasenko
function old new delta ash_main 1437 1442 +5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-11-28hush: typo fixes in commentsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-11-08ash: Set SHLVL in ASH_BASH_COMPATBernhard Reutner-Fischer
function old new delta ash_main 1456 1505 +49 .rodata 148488 148494 +6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 55/0) Total: 55 bytes Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-11-08ash: Use setvar2 some moreBernhard Reutner-Fischer
(add/remove: 0/0 grow/shrink: 10/15 up/down: 13/-27) Total: -14 bytes Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-07-14typo fix in commentDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-07-08typo fix in commentDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-07-05unicode: check $LC_CTYPE too to detect Unicode modeDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-07-02unicode: check $LC_ALL to detect Unicode mode, not only $LANGDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-05-12hush: fix build failure if FEATURE_EDITING=y && !HUSH_INTERACTIVEDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-04-07ash,hush: history builtinFlemming Madsen
function old new delta show_history - 39 +39 builtin_history - 16 +16 historycmd - 13 +13 bltins1 312 324 +12 builtintab 336 344 +8 popstring 134 140 +6 hush_main 1048 1046 -2 ash_main 1398 1396 -2 size_from_HISTFILESIZE 44 40 -4 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 3/3 up/down: 94/-8) Total: 86 bytes Signed-off-by: Flemming Madsen <busybox@themadsens.dk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-04-07hush: fix for "while false && true; do echo BUG; break; done". closes 6170Denys Vlasenko
function old new delta run_list 959 941 -18 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-03-17ash: add comment about failures in source builtin. No code changes.Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-03-17hush: source builtin should override $N only if it has argsDenys Vlasenko
function old new delta builtin_source 174 184 +10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-03-15ash: read $HOME/.profile instead of $(pwd)/.profileStefan Hellermann
ash --login should read ~/.profile instead of .profile in the current directory. I noticed it while trying to figure out why /root/.profile is only read sometimes. function old new delta ash_main 1374 1398 +24 Signed-off-by: Stefan Hellermann <stefan@the2masters.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-03-15ash: move code to allow setting $HOME in /etc/profileStefan Hellermann
move HISTFILE=$HOME/.ash_history below reading /etc/profile, so that /etc/profile can set $HOME. HOME can be unset when directly invoking ash --login from init without going through getty. Signed-off-by: Stefan Hellermann <stefan@the2masters.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-02-26move endofname() to libbbDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-01-17ash: revert wrong "fix" for an apparent memory leak. Closes 5822Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-01-15whitespace fixes. no code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-01-14whitespace cleanup. no code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-11-13ash: fix a memory leakJon Tollefson
The script which triggers the leak: while true do while true do break; done</dev/null done Signed-off-by: Jon Tollefson <kniht@linux.vnet.ibm.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-10-01ash: implement export -nDenys Vlasenko
function old new delta exportcmd 129 175 +46 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-09-25ash: trivial fixes for compile failuresDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-09-06ash: fix "read -s" + ^C. Closes 5504Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-07-24*: declare strings with ALIGN1, as appropriateMichael Tokarev
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-07-07ash: add a comment about VEXPORTDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-07-05include sys/resource.h where neededMike Frysinger
We use functions from sys/resource.h in misc applets, but don't include the header. This breaks building with newer glibc versions, so add the include where needed. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-06-09ash: fix a bug in >${varexp} handling. Closes 5282Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-04-26hush: remove sighandler_t definition hack, platform.h has it tooDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-04-20fix build breakage found by randconfigDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-03-27hush: remove unused member struct command::is_stoppedDenys Vlasenko
function old new delta builtin_umask 133 132 -1 checkjobs 551 544 -7 builtin_fg_bg 291 267 -24 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-02-04cttyhack: handle multiple consoles found in sysfsAaro Koskinen
If multiple consoles are found from the sysfs file, cttyhack fails: cttyhack: can't open '/dev/tty0 ttyS0': No such file or directory In such cases take the last one as the kernel will use that one for /dev/console. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-01-15shell_builtin_read: set cc[VMIN] to 1; lineedit: don't clear c_cc[VINTR]Denys Vlasenko
First change fixes "read -n NUM". Apparently poll() won't report data availability if cc[VMIN] > 1 until there are at least cc[VMIN] bytes. function old new delta read_line_input 3885 3877 -8 shell_builtin_read 1097 1087 -10 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-18) Total: -18 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-12-20ash: in standalone mode, search in $PATH if /proc/self/exe doesn't existDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-12-16ash: document bash's exit code too. No code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-12-16ash: add comment about bash's ENOEXEC handling. No code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-31cttyhack: move /sys/class/tty/console/active check to the frontDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-31cttyhack: print detected ctty name when called without parametersAlexander Shishkin
Sometimes there's a need to figure out the controlling tty from a shell script, for example, to obtain a line for getty. In this case it's easier to call cttyhack than trying to repeat some of the cttyhack's logic. function old new delta cttyhack_main 283 327 +44 packed_usage 28911 28915 +4 Signed-off-by: Alexander Shishkin <virtuoso@slind.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-09-04lineedit: remove SAVE_HISTORY bit, ->hist_file can be used as indicatorDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-09-04lineedit: add support for history saving on exitDenys Vlasenko
Based on the patch by Dennis Groenen <tj.groenen@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>