Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[OT][BASH] filtern von Wörtern in Großbuchstaben
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) Diskussionsforum
View previous topic :: View next topic  
Author Message
sarahb523
Guru
Guru


Joined: 10 Mar 2004
Posts: 423
Location: Berlin

PostPosted: Fri Jun 11, 2004 6:08 pm    Post subject: [OT][BASH] filtern von Wörtern in Großbuchstaben Reply with quote

Hallöchen alle miteiander :-)

auch ich möchte erstmal DANKE sagen das ihr hier alle so toll helft.

So nun hab ich auch noch gleich ein kleines Problemchen was ich nich so richtig weiß wie ich es lösen.

Ich brauch ein möglichst kleines script/eine befehlszeile welches mir alle dateien untereinander ausgibt die nur aus großen buchstaben (A-Z, keine umlaute) bestehen.

Also anstelle von:
.directory
README
test.log
myfile.dat
TODO

soll nach der befehlszeile folgendes stehen:
README
TODO


Meine idee ist folgendes:
ls -q1 . | grep --regexp="????"

Da wo die Fragezeichen sind weiß ich nich wie ich den regulären Ausdruck mache.

danke!
_________________
AMD Sempron 2400+ / 1GB RAM / NVidia Geforce 5200FX /
Kernel 2.6.31-gentoo-r4 / kde 4.3
Back to top
View user's profile Send private message
Little Nemo
l33t
l33t


Joined: 29 Mar 2004
Posts: 623
Location: Berlin, Germany

PostPosted: Fri Jun 11, 2004 6:15 pm    Post subject: Reply with quote

Code:
ls -q1 . | egrep ^[A-Z]+$
Back to top
View user's profile Send private message
sarahb523
Guru
Guru


Joined: 10 Mar 2004
Posts: 423
Location: Berlin

PostPosted: Fri Jun 11, 2004 7:03 pm    Post subject: Reply with quote

danke es funzt. ich schreib aber lieber grep -E das sieht besser aus ;-)

Kann mir jemand nen deutsches tutorial für reguläre ausdrücke empfehlen?
_________________
AMD Sempron 2400+ / 1GB RAM / NVidia Geforce 5200FX /
Kernel 2.6.31-gentoo-r4 / kde 4.3
Back to top
View user's profile Send private message
toskala
Advocate
Advocate


Joined: 14 Dec 2002
Posts: 2080
Location: hamburg, germany

PostPosted: Fri Jun 11, 2004 7:17 pm    Post subject: Reply with quote

sarahb523 wrote:
danke es funzt. ich schreib aber lieber grep -E das sieht besser aus ;-)

Kann mir jemand nen deutsches tutorial für reguläre ausdrücke empfehlen?


ein deutsches tutorial kenne ich nur in buchform, da bieten sich die regular expressions von o'reilly an. der englische titel lautet "mastering regular expressions" sollte auf deutsch wohl ähnlich heissen, und das ist alles was ein regex-benutzer jemals brauchen wird.

oh, das geht auch,

Code:
ls -q1 | sed -e '/[a-z]/d'

_________________
adopt an unanswered post
erst denken, dann posten
Back to top
View user's profile Send private message
toskala
Advocate
Advocate


Joined: 14 Dec 2002
Posts: 2080
Location: hamburg, germany

PostPosted: Sat Jun 12, 2004 11:55 am    Post subject: Reply with quote

dabei faellt mir ein, dass dir ein


ls -q1 [^a-z]*

vermutlich die beste performance bringen wird :)
_________________
adopt an unanswered post
erst denken, dann posten
Back to top
View user's profile Send private message
Little Nemo
l33t
l33t


Joined: 29 Mar 2004
Posts: 623
Location: Berlin, Germany

PostPosted: Sat Jun 12, 2004 12:02 pm    Post subject: Reply with quote

:o Mein ls kann mit regulären Ausdrücken jedenfalls nichts anfangen.
Back to top
View user's profile Send private message
toskala
Advocate
Advocate


Joined: 14 Dec 2002
Posts: 2080
Location: hamburg, germany

PostPosted: Sat Jun 12, 2004 2:49 pm    Post subject: Reply with quote

Little Nemo wrote:
:o Mein ls kann mit regulären Ausdrücken jedenfalls nichts anfangen.


komisch, geht perfekt hier
_________________
adopt an unanswered post
erst denken, dann posten
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum 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