delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/06/02/11:53:05

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:references:in-reply-to:subject:date
:message-id:mime-version:content-type:content-transfer-encoding;
q=dns; s=default; b=G654tUR1Li7yW5/flbb2V6tRannmGh1XJZ3qBk8HAJq
ygDhwfp3SC7Z46aMEDYycpr6KLeQxHefpqqR75019LjT2tGO+dVwyvT+54cgW8tL
KuTP1D0tWV3QRL3Ku1KGOSdL9664IL2gzS2oXNHiyJRzIUi+g+L9X8mftW6ut/74
=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:references:in-reply-to:subject:date
:message-id:mime-version:content-type:content-transfer-encoding;
s=default; bh=mnCm+ahm+3A4wltwygNmtXDPkJc=; b=fir+XG6MZ8SrOFpif
ZWr0NhULO5VX/UUG5V7H1kEQIRYB1XYgbGIUuF7F77gqN0sKo5Irwo25kKCSWp3a
b2f12OvPiSJvRZoUf++gvTFi6CPCKktNfOi5IDhnykrJ9hJt7aTWLPYhoB95qtzA
jymHi0TXFrDp9k+3aV60EEb0nM=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-0.0 required=5.0 tests=AWL,BAYES_05,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=editor, d2u, endings, dos2unix
X-HELO: resqmta-po-04v.sys.comcast.net
From: "Andy Hall" <fixpertise-consulting AT comcast DOT net>
To: "'Doug Henderson'" <djndnbvg AT gmail DOT com>, "'cygwin'" <cygwin AT cygwin DOT com>
References: <001801d2db33$5a560e90$0f022bb0$@comcast.net> <CAJ1FpuM77QAvSqu4qhm9ptbZibMNYNyLg=c14-Sr32x-mAFDeA AT mail DOT gmail DOT com>
In-Reply-To: <CAJ1FpuM77QAvSqu4qhm9ptbZibMNYNyLg=c14-Sr32x-mAFDeA@mail.gmail.com>
Subject: RE: Bash seg faulting?
Date: Fri, 2 Jun 2017 08:52:41 -0700
Message-ID: <002201d2dbb8$45646b00$d02d4100$@comcast.net>
MIME-Version: 1.0
X-CMAE-Envelope: MS4wfI9q/62tamYVJVIRQFkAJujbN9OCw2/1Glu8fiz1kNORQihaIDk3F2AhYgFDg7A7dzKO2xNgvjeeEq0SY4mB149DQzMfBmJho+bf42D6IvN32e7WyDW8 mDp2x/3e3OVzfY+d2TABvnUtLLPXYpP+9lQpwHaBVfJZPQBAQcPd7xngo0tnxAQkVT94CnlOWZj7dFqvZaaDoq3DQNmZnJfnlOQ=
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id v52Fr44s017701

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, conv.sh 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 conv.sh
> > #!/bin/bash
> >
> 
> Try running "cat -e conv.sh" 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 conv.sh" or "d2u conv.sh" to fix the line
> ending problem. Check that your editor can create files with unix line
> endings, and preserves unix line endings.
> 
> HTH
> 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:

#!/bin/bash

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
done

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).

$ conv.sh
converting: Post-Install.doc
0000000
converting: Post-InstallB.doc
0000000
converting: Post-InstallTest.doc
0000000

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

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










--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019