using Sed in Solaris bash

I am trying to execute a script with sed that works well in ksh(Linux) however in bash(solaris 8) though it does not give any errors the output file becomes 0 byte.

header of the script:
ksh:2$ head news.ksh
#!/bin/ksh
#------------------------------------------------------------------------------------------------------------
# Shell : KSH

CODE :
echo TWO
ls -lt /$HOME/.html
sed "s/Count/$COUNT/g" ${CONFIG_PATH}/news.html > ${CONFIG_PATH}/temp_query.html | mv ${CONFIG_PATH}/temp_query.html ${CONFIG_PATH}/news.html
echo THREE
ls -lt /app.1.0.2/
.html
rc2=$?

executed in bash shell using command:

sh -x new.ksh parameter1

Execution:
+ echo TWO
TWO
+ ls -lt /app.1.0.2/news.html
-rw-r--r-- 1 abc abc 1799 Jul 23 10:25 /app.1.0.2/news.html
+ mv /app.1.0.2/temp_query.html /app.1.0.2/news.html
+ sed s/Count/ 0/g /app.1.0.2/news.html
+ echo THREE
THREE
+ ls -lt /app.1.0.2/news.html
-rw-r--r-- 1 abc abc 0 Jul 23 10:25 /app.1.0.2/news.html
rc2=0

Looking at the execution all the variables are substituted ... I am not able to understand what is happening :confused: .. need help

To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags

```text
 and 
```

by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums

I suppose you mean the opposite: bash(Linux) vs ksh(Solaris 8).
The following line from your script is bogus.
You do not at the same time redirect a command to a file and pipe its output elsewhere. Moreover, mv isn't a command that expect a file from its standard input.

sed "s/Count/$COUNT/g" ${CONFIG_PATH}/news.html > ${CONFIG_PATH}/temp_query.html | mv ${CONFIG_PATH}/temp_query.html ${CONFIG_PATH}/news.html