address@hidden wrote:
I apologize if this is the wrong place to send this question.
GNU ed has not been updated in some time. So I suppose without a
better place this one is as good as any.
This a little test I'm doing that doesn't seem to work, but I can't see
anything wrong with it. Is this a bug?
Looks like a minor bug.
# Create an input file
cat << \EOF > -infile
aaa
bbb
aaa
EOF
#Create an input command file
cat << \EOF > cmdfile
1,$s/aaa/bbb/
w
q
EOF
#This command fails with or without '-s' option.
ed -s -- -infile < cmdfile
#The command returns a ?
echo $?
#returns 4. Don't have a clue what this means.
The 'ed' command appears to be not stopping option processing with the
"--". Instead it appears to be processing -infile as an option and
erroring.
Try this:
ed -s ./-infile < cmdfile
That should work.
Bob