This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Bash seg faulting?

On 1 June Doug Henderson wrote:
> On 1 June 2017 at 18:01, Andy Hall wrote:
> >
> > Here is a strange one.   I have two scripts, and conv.bat that do the same thing: scan the current directory for
> > .doc files and convert them to .docx files.  Here are the two scripts.
> >
> > $ cat
> > #!/bin/bash
> >
> Try running "cat -e" to see if you have dos line endings, e.g.
> CR LF, instead of unix line endings, e.g. LF only.
> If you do, run "dos2unix" or "d2u" to fix the line
> ending problem. Check that your editor can create files with unix line
> endings, and preserves unix line endings.
> Doug
First of all, the Wordconv.exe converts a .doc file to a .docx file, ostensible writing no output.   However, I find if I change the script to read:


OFFICE_BIN="C:\Program Files (x86)\Microsoft Office\root\Office16"

for doc in *.doc; do
        echo "converting: $doc"
        "$OFFICE_BIN"/Wordconv.exe -oice -nme "$doc" "${doc}x" | od

and run, I don’t get the seg faults, but od is showing no output written as you might expect (as in od <dev/null).

converting: Post-Install.doc
converting: Post-InstallB.doc
converting: Post-InstallTest.doc

So something is strange about this particular .exe being executed from bash.  (Remember that the .bat version of does not seg fault.

Sending the output of od to /dev/null silences the seg fault and spurious output; provoding a workaround.

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]