UUGRN

Re: ein kleines bash toot für den webserver

From
Christian Eichert <moga@...>
Date
Robert Schiele wrote:
[...]
>>In Dateien Verzeichnisse recursiv das Wort "BEISPIEL1" mit dem Wort "BEISPIEL2" ersetzt
[...]
> find /var/www/html/ -not -type d -print0 | xargs -0 sed -i -e 's/BEISPIEL1/BEISPIEL2/'

Vielen Dank ... ich muss aber dazu meckern ...

"sed" tut nicht
-i gibt es anscheinst nid ( in man sed auch nicht )

[er bringt das hier:]
sed: invalid option -- i
Usage: sed [OPTION]... {script-only-if-no-other-script} [input-file]...

-n, --quiet, --silent
suppress automatic printing of pattern space
-e script, --expression=script
add the script to the commands to be executed
-f script-file, --file=script-file
add the contents of script-file to the commands to be
executed
--help display this help and exit
-V, --version output version information and exit

If no -e, --expression, -f, or --file option is given, then the first
non-option argument is taken as the sed script to interpret. All
remaining arguments are names of input files; if no input files are
specified, then the standard input is read.

und ohne -i
^^^^^^^^^^^^
tut er es auf der konsole richtig, schreibt es aber nicht in die Datei.
Der Inhalt aller *zigtausend* Dateien wird angezeigt ... ein Buchstaben
Chaos.

mit --silent oder --quiet
^^^^^^^^^^^^^^^^^^^^^^^^^
zeigt er gar nichts mehr an tut aber auch nichts. ( er ersetzt die
Zeichenfolgen in der datei nicht.) Rechteproblem ?
ich habe den Befehl als root eingegenben. Datei gehoert www-data

alles andere klappt ...

:o(

--
CE
"Be liberal in what you accept, and conservative in what you send."
  Jon Postel, August 6, 1943 - October 16, 1998

Thread

In reply to: Re: ein kleines bash toot für den webserver Robert Schiele <rschiele@...>