E:\WINDOWS\system32\drivers\etc>sed '/10.20.30.40 mail.server.com/i' ./hosts.tst
sed: -e expression #1, char 1: unknown command: `''
E:\WINDOWS\system32\drivers\etc>sed -i "10.20.30.40 mail.server.com" hosts.tst
sed: -e expression #1, char 3: unknown command: `.'
hosts.tst enthält die Zeile 10.20.30.40 mail.server.com
Es mag mich nicht :-(
Ob es an der Version liegt?
E:\WINDOWS\system32\drivers\etc>sed --version
GNU sed version 4.2.1
Copyright (C) 2009 Free Software Foundation, Inc.
E:\>sed
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
-i[SUFFIX], --in-place[=SUFFIX]
edit files in place (makes backup if extension supplied)
-b, --binary
open files in binary mode (CR+LFs are not processed specially)
-c, --copy
use copy instead of rename when shuffling files in -i mode
(avoids change of input file ownership)
-l N, --line-length=N
specify the desired line-wrap length for the `l' command
--posix
disable all GNU extensions.
-r, --regexp-extended
use extended regular expressions in the script.
-s, --separate
consider files as separate rather than as a single continuous
long stream.
-u, --unbuffered
load minimal amounts of data from the input files and flush
the output buffers more often
--help display this help and exit
--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.
GNU sed home page: .
General help using GNU software: .