-
-
alias grep="grep -i" ?
-
-
Falls es tatsächlich ein alias ist, kannst du den mit dem kompletten Pfad (z.B. /bin/grep) umgehen.
Wozu das gut sein soll, mußt du wohl die Ubuntu-Leute fragen.
Gruß
Mag1c -
-
randy@schnuller:~/c > echo A | grep [a-z]
a
randy@schnuller:~/c > ls -la
insgesamt 20
-rw-r--r-- 1 randy users 0 Mai 25 16:26 a
-rw-r--r-- 1 randy users 2 Mai 25 16:27 x
randy@schnuller:~/c > cat x
a
randy@schnuller:~/c >-- randy
-
Zitat
Original von randy
randy@schnuller:~/c > echo A | grep [a-z]
a
randy@schnuller:~/c > ls -la
insgesamt 20
-rw-r--r-- 1 randy users 0 Mai 25 16:26 a
-rw-r--r-- 1 randy users 2 Mai 25 16:27 x
randy@schnuller:~/c > cat x
a
Der ist auch gut!Was die Shell nicht so alles macht, wenn man die Anführungszeichen vergißt...
CU
oliver -
Kann mir mal jemand diese Ausgabe erklären, warum das ganze so funktioniert?
Kapiere das einfach nicht.
ThomasZitatOriginal von randy
randy@schnuller:~/c > echo A | grep [a-z]
a
randy@schnuller:~/c > ls -la
insgesamt 20
-rw-r--r-- 1 randy users 0 Mai 25 16:26 a
-rw-r--r-- 1 randy users 2 Mai 25 16:27 x
randy@schnuller:~/c > cat x
a
randy@schnuller:~/c > -
naja, die bash uebersetzt [a-z] mit "a b c d e ...."
d.h. der grep sieht dann so aus:
echo A | grep a b c d e ...
grep a x passt ja dann
-- randy
-
wobei die Shell da schon gemein ist:
[endriss@orion test]$ ls
[endriss@orion test]$ echo [a-z]
[a-z]
[endriss@orion test]$ touch a x
[endriss@orion test]$ echo [a-z]
a x
[endriss@orion test]$CU
Oliver
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!