Afficher un message
Vieux 19/05/2007, 03h58   #5
James Michael Fultz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how to detect the dir to cd to begins with a dot

* Harry331 <harryooopotter@hotmail.co_>:
> paintedjazz@gmail.com wrote...
>>
>>Is there a way in a bash script to detect if the directory one is
>>about to cd into is a directory that begins with a dot?
>> [ ... ]

>
> everything from
> find . -type d
> starts with a dot.
>
> e.g.
>
> $ cd /cygdrive/c/cygwin
> $ find . -type d
> .
> ./etc
> ./etc/setup
> ./etc/postinstall
> ./etc/defaults
> ./etc/defaults/etc
> [snip]
>
> Isn't it?


You are quite right! Something I overlooked too. I suppose the
simplest solution using find is to have find itself test for and exclude
directories beginning with a dot.

$ ls -A
..quux bar baz foo

$ find . -type d ! -name '.*' -print
../foo
../bar
../baz

--
James Michael Fultz <xyzzy@sent.as.invalid>
Remove this part when replying ^^^^^^^^
  Réponse avec citation
 
Page generated in 0,05230 seconds with 9 queries