Tiny Core Linux

Tiny Core Base => TCB Bugs => Topic started by: dentonlt on January 19, 2016, 07:22:06 PM

Title: busybox: length applet missing (6.4, 7.0beta, others?)
Post by: dentonlt on January 19, 2016, 07:22:06 PM
I have 6.4 and 7.0beta1 at home - both missing the busyboxy 'length' applet. /usr/bin/length exists.

Perhaps others running 5.x and 4.x can confirm whether the length applet exists on those releases?
Title: Re: busybox: length applet missing (6.4, 7.0beta, others?)
Post by: Rich on January 19, 2016, 07:45:37 PM
Hi dentonlt
On TC4,  length  is missing from  busybox  and  /usr/bin/length  is a link back to  /bin/busybox.
Title: Re: busybox: length applet missing (6.4, 7.0beta, others?)
Post by: Juanito on January 19, 2016, 09:17:48 PM
If you enter the command "busybox" it will list all of the available commands.
Title: Re: busybox: length applet missing (6.4, 7.0beta, others?)
Post by: Rich on January 19, 2016, 09:37:43 PM
Hi Juanito
Yes, I realize that. The command is not compiled into busybox but is included in /usr/bin/:
Code: [Select]
tc@box:~$ which length
/usr/bin/length
tc@box:~$ ls -l /usr/bin/length
lrwxrwxrwx 1 root root 17 Nov 16  2011 /usr/bin/length -> ../../bin/busybox
tc@box:~$ length
length: applet not found
tc@box:~$
Title: Re: busybox: length applet missing (6.4, 7.0beta, others?)
Post by: Juanito on January 19, 2016, 09:46:52 PM
I looked quickly at a couple of busybox config files and "length" is not mentioned...
Title: Re: busybox: length applet missing (6.4, 7.0beta, others?)
Post by: Rich on January 19, 2016, 09:55:46 PM
Hi Juanito
It is listed here:
https://busybox.net/BusyBox.html#length
Title: Re: busybox: length applet missing (6.4, 7.0beta, others?)
Post by: Juanito on January 19, 2016, 09:59:56 PM
Sure  :)

I meant that it is not mentioned one way or the other in the config - i.e. whether to compile it in or leave it out.
Title: Re: busybox: length applet missing (6.4, 7.0beta, others?)
Post by: Rich on January 19, 2016, 10:12:04 PM
Hi Juanito
It shows up in this config file under Coreutils:
http://siso.sourceforge.net/ap-busybox-config.html
Title: Re: busybox: length applet missing (6.4, 7.0beta, others?)
Post by: curaga on January 20, 2016, 01:13:42 AM
It was removed from busybox in 2011. We need to remove the symlink.
Title: Re: busybox: length applet missing (6.4, 7.0beta, others?)
Post by: Rich on January 20, 2016, 06:41:33 AM
Hi curaga
Thank, that explains it. It never occurred to me it might have been removed.
Title: Re: busybox: length applet missing (6.4, 7.0beta, others?)
Post by: Rich on January 20, 2016, 06:42:36 AM
Hi Juanito
Sorry if I sent you on a wild goose chase.
Title: Re: busybox: length applet missing (6.4, 7.0beta, others?)
Post by: Rich on January 20, 2016, 06:45:49 AM
Hi dentonlt
According to this:
https://gitlab.com/dstam/sali/blob/master/CHANGELOG

Quote
  * Since busybox 1.19.0 command length has been removed. Now using ${#VAR}
    to get the length of the variable VAR.
    Author: Dennis Stam

Code: [Select]
tc@box:~$ echo $PWD
/home/tc
tc@box:~$ echo ${#PWD}
8
tc@box:~$
Title: Re: busybox: length applet missing (6.4, 7.0beta, others?)
Post by: dentonlt on January 20, 2016, 05:19:00 PM
Thanks, all - this makes sense. Good to know the link it was only a loose end.

FWIW ... I expect ${#foo} is faster. Maybe I'll make a little script to find out. :p