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

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

Re: Maybe an issue with SED redirection or I missed something


From: Eli Zaretskii
Subject: Re: Maybe an issue with SED redirection or I missed something
Date: Thu, 24 Mar 2011 22:09:14 +0200

> Date: Thu, 24 Mar 2011 10:44:12 -0600
> From: "Rodney Fisher" <address@hidden>
> Cc: Rodney Fisher <address@hidden>
> 
> I have tried a few tests with the SED command.
> 
> It seems to not handle the redirection arrows very well.....

It's not a Sed problem.  You are tripping the Windows shell by using
unbalanced quotes.

> Y:\testsed>sed "s/\"//g" rf1 > rf2
> Test sed to remove quotes.
> Even if line like this has no quotes.
> Or just has 1 quote like this line.
> sed: can't read >: Invalid argument
> sed: can't read rf2: No such file or directory

Because there are 3 quotes on the command line, cmd.exe gets confused
and thinks that ">" is a file name.

You use a backslash to escape the second quote, but cmd.exe does not
support such escapes.

In general, if you need to play with quotes on Windows, put your Sed
command in a file and use "sed -f YOUR-FILE".



reply via email to

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