[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Using -prune option of find to ignore hidden directories



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, May 03, 2017 at 04:38:15PM -0400, Greg Wooledge wrote:
> On Wed, May 03, 2017 at 10:22:57PM +0200, tomas@tuxteam.de wrote:
> > FWIW, a trick to see what's really going on is to prepend an echo
> > before all that:
> > 
> >   echo find /home/richard -type d -name .*
> > 
> > (for the example above). Of course you won't think of that if you
> > are't suspecting shell expansion in the first place, but I find
> > it very instructive to see what the shell is "seeing". That'll
> > help memory for the next time (it does for me, at least).
> 
> Yeah, that's a good start.  I actually have a little script I wrote,
> called "args":
> 
> wooledg:~$ cat bin/args
> #!/bin/sh
> printf "%d args:" "$#"
> printf " <%s>" "$@"
> echo

[...]

Nifty!

At the same time it shows the power of the shell's text substitution
model, which at the same time is its weakness. Shell is a very
interesting language model, somewhat dual to the languages in
fashion these days. Tread carefully :-)

cheers
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlkKSOcACgkQBcgs9XrR2ka6+gCcCKKVWMTqnZQYzriaOsT7YMyW
7jEAn3IEVFDBC4cvrhBQGxRnNmYWkrWL
=KUWv
-----END PGP SIGNATURE-----


Reply to: