WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: busybox: length applet missing (6.4, 7.0beta, others?)  (Read 3647 times)

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
busybox: length applet missing (6.4, 7.0beta, others?)
« 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?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11221
Re: busybox: length applet missing (6.4, 7.0beta, others?)
« Reply #1 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.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14546
Re: busybox: length applet missing (6.4, 7.0beta, others?)
« Reply #2 on: January 19, 2016, 09:17:48 PM »
If you enter the command "busybox" it will list all of the available commands.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11221
Re: busybox: length applet missing (6.4, 7.0beta, others?)
« Reply #3 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:~$

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14546
Re: busybox: length applet missing (6.4, 7.0beta, others?)
« Reply #4 on: January 19, 2016, 09:46:52 PM »
I looked quickly at a couple of busybox config files and "length" is not mentioned...

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11221
Re: busybox: length applet missing (6.4, 7.0beta, others?)
« Reply #5 on: January 19, 2016, 09:55:46 PM »
Hi Juanito
It is listed here:
https://busybox.net/BusyBox.html#length

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14546
Re: busybox: length applet missing (6.4, 7.0beta, others?)
« Reply #6 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.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11221
Re: busybox: length applet missing (6.4, 7.0beta, others?)
« Reply #7 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

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10962
Re: busybox: length applet missing (6.4, 7.0beta, others?)
« Reply #8 on: January 20, 2016, 01:13:42 AM »
It was removed from busybox in 2011. We need to remove the symlink.
The only barriers that can stop you are the ones you create yourself.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11221
Re: busybox: length applet missing (6.4, 7.0beta, others?)
« Reply #9 on: January 20, 2016, 06:41:33 AM »
Hi curaga
Thank, that explains it. It never occurred to me it might have been removed.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11221
Re: busybox: length applet missing (6.4, 7.0beta, others?)
« Reply #10 on: January 20, 2016, 06:42:36 AM »
Hi Juanito
Sorry if I sent you on a wild goose chase.
« Last Edit: January 20, 2016, 06:46:47 AM by Rich »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11221
Re: busybox: length applet missing (6.4, 7.0beta, others?)
« Reply #11 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:~$
« Last Edit: January 20, 2016, 06:50:40 AM by Rich »

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
Re: busybox: length applet missing (6.4, 7.0beta, others?)
« Reply #12 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