WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: find  (Read 148 times)

Offline polikuo

  • Sr. Member
  • ****
  • Posts: 348
find
« on: July 10, 2018, 03:17:42 AM »
Hi !

I was looking for my old codes and came across this problem.
Both find command in busybox and findutils.tcz have this behavior.
Somehow they just couldn't see the *.c files unless you're in the directory.

Code: [Select]
tc@box:~$ version
9.0
tc@box:~$ uname -r
4.14.10-tinycore64
tc@box:~$ mkdir /tmp/source
tc@box:~$ touch /tmp/source/file.c /tmp/source/file.cxx
tc@box:~$ find /tmp/source/
/tmp/source/
/tmp/source/file.cxx
/tmp/source/file.c
tc@box:~$ find /tmp/source/ -name *.c
tc@box:~$ find /tmp/source/ -name *.cxx
/tmp/source/file.cxx
tc@box:~$ which find
/usr/bin/find
tc@box:~$ realpath /usr/bin/find
/bin/busybox
tc@box:~$ tce-load -si findutils
tc@box:~$ /usr/local/bin/find /tmp/source -name *.c
tc@box:~$ cd /tmp/source/
tc@box:/tmp/source$ busybox find -name *.c
./file.c
tc@box:/tmp/source$ busybox find /tmp/source -name *.c
/tmp/source/file.c
tc@box:/tmp/source$ /usr/local/bin/find -name *.c
./file.c
tc@box:/tmp/source$ /usr/local/bin/find /tmp/source -name *.c
/tmp/source/file.c

Offline andyj

  • Hero Member
  • *****
  • Posts: 607
Re: find
« Reply #1 on: July 10, 2018, 04:22:21 AM »
Try putting the *.c in single quotes. The shell is expanding the *.c before it's passed to find.

Offline polikuo

  • Sr. Member
  • ****
  • Posts: 348
Re: find
« Reply #2 on: July 10, 2018, 05:43:51 AM »
Try putting the *.c in single quotes. The shell is expanding the *.c before it's passed to find.

Oh~~

There's a ".c" file in my home directory, silly me.

Sorry for the noise.  :-[