delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/06/02/12:12:01

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:mime-version:in-reply-to:references:from:date
:message-id:subject:to:content-type:content-transfer-encoding;
q=dns; s=default; b=aSKMzvvOJuavdAMtOxcvCKteakhkccV2G6TIP0ptNS0
eyoCAr6AjkVxiGgnDB/eh+R9iNNd0z19/OLr7gUO3b464hiAfB5aZChy2sOp9S3L
83SEU9/3hNoaCdgrNnqzq8sUgj8tT9C8LlmRd5Emgt2m9DwsEDVO0Y1SrOwgjaT4
=
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:mime-version:in-reply-to:references:from:date
:message-id:subject:to:content-type:content-transfer-encoding;
s=default; bh=GyJ0ka1LqOA7PFoIySTugdglJ7U=; b=nPWeQH8lvI23RxMZi
pgKiHblHB2vs1F3m2dWSMOHQcpuQlzPTHlJPDRIbx20M1TVzmdsYLJ+UMJELkufg
/l2T6Jydg98tvKr33+vmF245nsyCDNk2rJ3kHiAXm1i6Q+kuLcTtd2bin5dzPXkA
KqfhbWm/yHRiznVOz6/Ndt8uY0=
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.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_LINEPADDING,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=unsubscribe-simple, unsubscribesimple, office, Office
X-HELO: mail-oi0-f54.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=hDg9+xdirAY/09+yzncgH0JUIcRx7O9PEFqDSj8Y93I=; b=MIEsEKYok8o6KE00PXmptOuiuK0TuWYdSIEdF2QTQAqej/f1dBvuEd7oCY9RosKq14 myiRzt3Vsqbf6kPUVCWrs8vRYJZBTiJPcumiqrfmUjEqAQu7TikjHPwSRFGD3Z1+4ZTQ rft5x+drmXR7VtZ27aTrtkw3+VEuI8IxURvVpOnUZtX/HH143HIi37Aeo78oN7ARDlL+ WQ0gJ4nwClkQRRTufVVgNk5/mneAC4XrIwGXpc7yklvZMXIfME0sVyiUlpqClKkETq5k KpJlfh9HoKPzSkVGTlrgD1v0JWfFl2ZgvbZMyMSReRNIXlC9sNo8lOA0VK543ogiHbVr PEVQ==
X-Gm-Message-State: AODbwcDHaYHR5bltBoPlNFsT6Dcb7W/gXise1i3PtAe16gfeF6xUM906 pTAl4abEzRN/nOUPpfpaWYETvJRgig==
X-Received: by 10.157.46.11 with SMTP id q11mr5298251otb.129.1496419902918; Fri, 02 Jun 2017 09:11:42 -0700 (PDT)
MIME-Version: 1.0
In-Reply-To: <002201d2dbb8$45646b00$d02d4100$@comcast.net>
References: <001801d2db33$5a560e90$0f022bb0$@comcast.net> <CAJ1FpuM77QAvSqu4qhm9ptbZibMNYNyLg=c14-Sr32x-mAFDeA AT mail DOT gmail DOT com> <002201d2dbb8$45646b00$d02d4100$@comcast.net>
From: Jack Adrian Zappa <adrianh DOT bsc AT gmail DOT com>
Date: Fri, 2 Jun 2017 12:11:42 -0400
Message-ID: <CAKepmaizt+cqc9T+hSB-vAt6XthGszgO-ALrwaf1r1AnXf2YSA@mail.gmail.com>
Subject: Re: Bash seg faulting?
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id v52GBxDR018848

How about using -xv on your first line to see what is actually being
executed when doing substitution?

I.e.
#!/bin/bash -xv

Another possibility is that Wordconv.exe requires .DLLs that are not
found in the path.

HTH


A

On Fri, Jun 2, 2017 at 11:52 AM, Andy Hall
<fixpertise-consulting AT comcast DOT net> wrote:
> 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
>

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