`sed: -e expression #1, char 1: unknown command: `,'`
<p>I get the below error on running above command from shell script in CYGWIN.</p>

<p>Error:</p>

<blockquote>
  <p>sed: -e expression #1, char 1: unknown command: `,'</p>
</blockquote>

<p>IF I ran command in cmd:</p>

<pre><code>$ sed -n "8937,8946 p" "/cygdrive/c/TEMP/temp_oracle/alert_cert1_copy.log" | egrep -e "ORA-|Shutting down"
</code></pre>

<p>It works OK - Result:</p>

<pre><code>ORA-1623 signalled during: ALTER DATABASE DROP LOGFILE GROUP 1...
Shutting down database
</code></pre>

<p>NOTE: <code>8937</code> &amp; <code>8946</code> are the line numbers in text file - where it is needed to check the patterns. Searching must be between these lines.</p>

<p>IF I run the command in from shell script - the above error appears.</p>

<hr>

<p>Shell Script:</p>

<pre><code>    export alert_file="/cygdrive/c/TEMP/temp_oracle/alert_cert1_copy.log"
    export alert_output="/cygdrive/c/cygwin64/home/alert_out.log"

        function searchAlertByFilterLN() {
            #err1=$(sed -n "${lastLineNum},${totLines} p" $alert_file | egrep -e "ORA-")
            err1=$(sed -n "8937,8946 p" $alert_file | egrep -e "ORA-|Shutting down")
                if [ -n "$err1" ]; then  
                echo -e "Errors found:" &gt; $alert_output
                echo ------------       &gt;&gt; $alert_output
                sed -n "8937,8946 p" $alert_file | egrep -e "ORA-|Shutting down" &gt;&gt; $alert_output
                echo "" &gt;&gt; $alert_output
                echo "" &gt;&gt; $alert_output
                echo -e "Check the details of the errors below. (Details means the surroundig lines of the error message only)" &gt;&gt; $alert_output
                echo  "-------------------------------------" &gt;&gt; $alert_output
                sed -n "8937,8946 p" $alert_file | /usr/bin/egrep -A 5 -B 2 "ORA-|Shutting down" &gt;&gt; $alert_output
                fi
        }

searchAlertByFilterLN --
echo "function was executed"
</code></pre>

<p>With regards!</p>