1. Are you ready for the Galaxy S20? Here is everything we know so far!

A quickie: unexpected files in /system/bin

Discussion in 'Android Apps & Games' started by HappyJoe, May 25, 2011.

  1. HappyJoe

    HappyJoe Member
    Thread Starter

    I opened /system/bin and saw two files at the top of the ls -a -l command output: '[' and '[['. Both were links into busybox. What is their function? A bit like '.' and '..' maybe?
     



    1. Download the Forums for Android™ app!


      Download

       
  2. kevin@teslacoilsw

    kevin@teslacoilsw Well-Known Member

    In unix shell scripting, [ is a shortcut for the "test" command. This means instead of writing something like
    Code (Text):
    1.  
    2. if test $i == 10; then
    3.   echo "equals!"
    4. fi
    5.  
    One can write:
    Code (Text):
    1.  
    2. if [ $i == 10 ]; then
    3.   echo "equals!"
    4. fi
    5.  
    http://en.wikipedia.org/wiki/Test_(Unix)


    Not sure about [[ but i imagine it's related.
     
    HappyJoe likes this.
  3. HappyJoe

    HappyJoe Member
    Thread Starter

    Thanks for that '[[' is also a kosher bash ('compound') command.

    Something new every day!
     
Loading...

Share This Page

Loading...