Sieve filter script EXECUTION FAILED

Bernd Petrovitsch bernd at petrovitsch.priv.at
Fri Oct 30 22:41:05 EET 2020


On Fri, 2020-10-30 at 12:21 -0600, @lbutlr wrote:
> On 30 Oct 2020, at 11:25, Bernd Petrovitsch <bernd at petrovitsch.priv.at> wrote:
> > On 30/10/2020 17:11, @lbutlr wrote:
> > [...]
> > > echo $1 | sed -e '|</head>|<style>* {color:white !important; background-color: black !important; } </style></head>|'
> > 
> > What should the sed stuff do?
> 
> Changes </head> to <style>* {color:white !important; background-color: black !important; } </style></head>
> 
> > TTBOMK '|' is not known by sed ...
> 
> Yes, it most certainly is.

Perhaps try the script beforehand in a terminal:
----  snip  ----
{2}sed -e '|x|y|'
sed: -e expression #1, char 1: unknown command: `|'
----  snip  ----
So no, it's not.

You actually wanted:
----  snip  ----
echo $1 | sed -e 's|</head>|<style>* {color:white !important; background-color: black !important; } </style></head>|'
----  snip  ----

Or just use bash (and avoid anorther fork()+exec()):
----  snip  ----
#!/bin/bash --norc
echo ${1/<\/head>/<style>* {color:white !important; background-color: black !important; } <\/style><\/head>}'
----  snip  ----
Caveat emptor: Untested!

I know all that stuff about sed (GNU-sed and other sed's ..) ...

MfG,
	Bernd
-- 
Bernd Petrovitsch                  Email : bernd at petrovitsch.priv.at
There is no cloud, just other people computers. - FSFE
                     LUGA : http://www.luga.at




More information about the dovecot mailing list