Hallo,
Ich hatte vor langer Zeit mal gewusst, wie ich aus einer conf.file automatisch alle einträge entferne, die mit # beginnen.
Lieder ist mir dies wieder netfallen. Glaube, dass ich damals ne File durchsucht habe und alle Einträge, die nicht mit # begonnen haben in ne andere file geschrieben habe. Ist das so richtig? Wenn ja, wie würde denn dann der Befehl lauten?
Gruß
Tobias
httpd.conf alle kommentare entfernen
Re: httpd.conf alle kommentare entfernen
Code: Select all
sed '/^(#.*)*$/d' /path/to/httpd.confPayPal.Me/JoeUser ● FreeBSD Remote Installation
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Re: httpd.conf alle kommentare entfernen
hallo joe,
ich habe deinen Code ausprobiert.
Allerdings ist da nichts passiert.
Gruß
Tobias
ich habe deinen Code ausprobiert.
Allerdings ist da nichts passiert.
Gruß
Tobias
Re: httpd.conf alle kommentare entfernen
Dir wurde die bereinigte httpd.conf auf der Console ausgegeben. Wenn Du eine neue Datei erstellen willst, musst Du die Ausgabe entsprechend umleiten (sed...>/path/to/file) und wenn Du die Änderungen am Original vornehmen willst, setzt Du einfach "-i " (ohne Hochkommata) vor den Dateinamen.
PayPal.Me/JoeUser ● FreeBSD Remote Installation
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Re: httpd.conf alle kommentare entfernen
Hallo,
In der Consolenausgabe standen aber trotzdem noch einträge mit # drin. Deswegen dachte ich das es nicht funktionieren würde.
Habe aber gesehen, das die meisten entfernt wurden. Nur die mit vielen führenden Leerzeichen nicht.
Gruß
Tobias
In der Consolenausgabe standen aber trotzdem noch einträge mit # drin. Deswegen dachte ich das es nicht funktionieren würde.
Habe aber gesehen, das die meisten entfernt wurden. Nur die mit vielen führenden Leerzeichen nicht.
Gruß
Tobias
Re: httpd.conf alle kommentare entfernen
Code: Select all
sed '/^([[:space:]]*#.*)*$/d' /path/to/httpd.confPayPal.Me/JoeUser ● FreeBSD Remote Installation
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Re: httpd.conf alle kommentare entfernen
Vielen Dank
Tobias
Tobias
