bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sed


From: Stepan Kasal
Subject: Re: sed
Date: Wed, 30 Mar 2005 18:47:46 +0200
User-agent: Mutt/1.4.1i

Hi,
  well, this is a bug report address.  You should rather direct your question
to address@hidden or to comp.unix.shell newsgroup.

> i want to replace a " " character (blank) with "." character

> My command is: sed s." ".".".g
> error: sed: -e expression #1,char 6:Unknow option ti 's'.
... 
> Can you write the correct sequence command to do so?

"sequence command" ?  I dont' understand what you mean.
"sed" is a "stream editor" and the "s" command stands for "substitution".

The correct command is this:
s/ /./g

instead of /, you can use any other character, for example comma,
but it's not convenient to use "." as the delimiter here.

To use the command, you have two options:
1) give it as a parameter to sed; if you are working with a unix shell,
eg. on GNU/Linux, do this:

sed "s/ /./" g infile >outfile
or
sed 's/ /./' g infile >outfile

If you are on windows, the former could work, too.  Or you can place the
command
s/ /./g
to a file, say subst.sed, and then run

sed -f subst.sed infile >outfile

HTH,
        Stepan Kasal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]