WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline dentonlt

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

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: busybox: length applet missing (6.4, 7.0beta, others?)
« Reply #1 on: January 19, 2016, 10:45:37 PM »
Hi dentonlt
On TC4,  length  is missing from  busybox  and  /usr/bin/length  is a link back to  /bin/busybox.

Online Juanito

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

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: busybox: length applet missing (6.4, 7.0beta, others?)
« Reply #3 on: January 20, 2016, 12:37:43 AM »
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:~$

Online Juanito

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

Online Rich

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

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14801
Re: busybox: length applet missing (6.4, 7.0beta, others?)
« Reply #6 on: January 20, 2016, 12:59:56 AM »
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.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: busybox: length applet missing (6.4, 7.0beta, others?)
« Reply #7 on: January 20, 2016, 01:12:04 AM »
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: 11044
Re: busybox: length applet missing (6.4, 7.0beta, others?)
« Reply #8 on: January 20, 2016, 04: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.

Online Rich

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

Online Rich

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

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: busybox: length applet missing (6.4, 7.0beta, others?)
« Reply #11 on: January 20, 2016, 09: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, 09: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, 08: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