"sh: #: unknown operand" - How do I get rid of this error on shell script?

I have a shell script which when executed works fine, but gives a warning:

sh: #: unknown operand

In this shell script, I want to comment out the processes namely "process1" and "process2", which are also shell scripts designed for other tasks, and after commenting them out, I want to transfer the contents of path1 to a file in path2

#!/bin/sh
rootpath="/opt/storage"
datestring=`date +"%y-%m-%d"`
touch newfile1
touch newfile2
autorun_contents=`cat FILE1`
if [ ! -f ${FILE1} ] || [ -z "`echo \"${FILE1}\" | tail -10 | grep EOF`" ]; then
echo "Something was wrong with the file"
return
fi
sed "s/.\/process1/# .\/process1/g" FILE1 > FILE2 | echo "Hi1"
sed "s/.\/process2/# .\/process2/g" FILE1 > FILE2 | echo "Hi2"

Any suggestions would be greatly appreciated. Thanks!

1 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like