Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ordner ermitteln durch kleines script
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
unix
l33t
l33t


Joined: 06 Jul 2003
Posts: 615
Location: Dürnten ZH Switzerland

PostPosted: Wed Sep 15, 2004 8:11 am    Post subject: ordner ermitteln durch kleines script Reply with quote

Hi @ all

ich habe mehrere ordner z.b

/home/hans
/home/peter
/home/beat

usw.

einige dieser ordner haben unterordner xxxx/General_Info

wie kann ich jetzt ein script machen, dass bei jedem ordner reingukt ob ein order General_Info existiert

wenn einer da ist soll er schauen, ob dieser folder leer ist
und falls er leer ist soll er mir den ganzen pfad angeben.

wie kann ich so was machen?
_________________
Neue Funktionen in Portage 2.0.51 || BBCode Guide
Linux User #379064
Back to top
View user's profile Send private message
_hephaistos_
Advocate
Advocate


Joined: 07 Apr 2004
Posts: 2694
Location: salzburg, austria

PostPosted: Wed Sep 15, 2004 8:15 am    Post subject: Re: ordner ermitteln durch kleines script Reply with quote

hmmm mit "find"?
find /home -name "General_Info"

hth,
ciao
Back to top
View user's profile Send private message
unix
l33t
l33t


Joined: 06 Jul 2003
Posts: 615
Location: Dürnten ZH Switzerland

PostPosted: Wed Sep 15, 2004 8:21 am    Post subject: Reply with quote

jo mit
Code:

ls `find /home -name "General_Info"`


kann ich sehen welche einen inhalt haben und welche nicht.
jetzt möchte ich aber alle die keinen inhalt haben herausfiltern...
_________________
Neue Funktionen in Portage 2.0.51 || BBCode Guide
Linux User #379064
Back to top
View user's profile Send private message
Deever
Veteran
Veteran


Joined: 06 Jul 2002
Posts: 1354
Location: Zürich / Switzerland

PostPosted: Wed Sep 15, 2004 10:38 am    Post subject: Reply with quote

zsh-only:
Code:
for i (*(/)) { [[ ! -d $i/General_Info ]] && mkdir General_Info }


SCNR,
/dev

http://strcat.neessen.net/zsh/
http://www.michael-prokop.at/computer/tools_zsh_liebhaber.html
http://zsh.sunsite.dk/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum