<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">I'm glad that you've found a
solution. I don't show a reply on this issue from Jim Asman, so
I'm assuming his reply was off-list. So for the sake of others
reading this thread, I'll stress again that, for the example
given, no backslashing was needed to start with - and no need to
express the single quote as chr(39). All that was needed was to
use the single quote "as-is". To me, that also makes it easier to
understand if I had to come back to such code years later.<br>
<br>
On 12/8/14, 9:58 AM, James Flanagan wrote:<br>
</div>
<blockquote
cite="mid:D2B8689D-AE54-452B-809A-9B049BD179EC@Flantec.com"
type="cite">
<meta http-equiv="Context-Type" content="text/html; charset=utf-8">
I want to thank everybody for chiming in their suggestions.
<div class=""><br class="">
</div>
<div class="">It turns out that Jim Asman’s suggestion:</div>
<div class=""><br class="">
</div>
<div class="">Try using chr(39) rather than \' and see if you get
any further. <br class="">
<div class=""><br class="webkit-block-placeholder">
</div>
<div class="">was exactly what I needed to make my code work
properly. for those who suggested putting the code into an
external script, my preference is to keep the code within
filepro whenever possible for debugging purposes. </div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">IN ADDITION, </div>
<div class=""><br class="">
</div>
<div class="">thank you for pointing out the unnecessary use of
cat in my code. Some 15 years ago, one of my first unix
instructors taught me that method of using sed (stream editor)
that you first needed to put something in the stream (using
something such as cat). for as many times as i have been in
the man pages of sed, I never noticed that sed can exists as a
stand alone command. old habits die hard, but i assure you i
will not be repeating that one going forward. </div>
<div class="">
<span class="Apple-style-span">
<div class=""><br class="Apple-interchange-newline">
James Flanagan</div>
<div class=""><span class=""><a moz-do-not-send="true"
href="http://Flantec.com/" class="">Flantec.com</a></span></div>
<div class=""><br class="">
</div>
<div class=""><span class="">email:<span
class="Apple-tab-span"> </span><a
moz-do-not-send="true" href="mailto:James@Flantec.com"
class=""><span class="">James@Flantec.com</span></a></span></div>
<div class="">mobile:<span class="Apple-tab-span"> </span>760-458-8498</div>
<div class="">home:<span class="Apple-converted-space"> </span><span
class="Apple-tab-span"> </span>219-221-6219</div>
<div class=""><span class="">text:<span
class="Apple-tab-span"> </span><a
moz-do-not-send="true"
href="mailto:7604588498@txt.att.net" class=""><span
class="">7604588498@txt.att.net</span></a></span></div>
<div class=""><br class="">
</div>
<div class="">aim:<span class="Apple-tab-span"> </span>Flantec</div>
<div class="">oovoo:<span class="Apple-tab-span"> </span>Flantec</div>
<div class="">Skype:<span class="Apple-tab-span"> </span>Flantec</div>
<div class=""><span class="">ichat:<span
class="Apple-tab-span"> </span><a
moz-do-not-send="true" href="mailto:Flantec@mac.com"
class=""><span class="">Flantec@mac.com</span></a></span></div>
<div class=""><br class="">
</div>
<div class="">home:<span class="Apple-tab-span"> </span>1901
Cidermill Road</div>
<div class=""><span class="Apple-tab-span"> </span>Michigan
City, IN 46360</div>
</span>
</div>
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Dec 6, 2014, at 10:42 PM, Bruce Easton <<a
moz-do-not-send="true" href="mailto:bruce@stn.com"
class="">bruce@stn.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class=""><span class="">On 12/6/14, 5:38 PM, James
Flanagan wrote:</span><br class="">
<blockquote type="cite" class="">ok, I may have
accidentally not included all the code to make myself
clear. my apologies.<br class="">
<br class="">
::html_file="/www/"{5{"/"{1{".html":<br class="">
:exists(html_file) eq "0":unix="cat /www/template.html |
sed \'s/XXXXX/"{1{"/g\' >"<html_file:<br class="">
::msgbox unix:<br class="">
:exists(html_file) eq "0":system noredraw unix:<br
class="">
<br class="">
<br class="">
The msgbox command is just there for troubleshooting.
when i test it, I get the following in the msgbox:<br
class="">
<br class="">
cat /www/template.html | sed 's/XXXXX/wcpc1/g' >
/www/wcc/wcpc1.html<br class="">
<br class="">
Copying and pasting the output of the msgbox does work
properly to achieve the intended goal. however, the
command when run from the system command, results in an
empty destination file. that tells me that system
command is processing the command all the way to the
end, and is getting tripped up on the single quote (or
possibly the pipe) somewhere in the middle.<br class="">
<br class="">
so my question again is there a way to send such a
command and have the filepro system command pass it to
the system properly?<br class="">
</blockquote>
<span class="">[..]</span><br class="">
<br class="">
<span class="">Removing the unnecessary backslashes before
the single quotes should make your code work as
expected, James. (Note this difference between your
code and Ken's example. If you don't get any output at
all after that change, then you might need to look at
permissions for your output destination. But since you
said "empty destination", I'm assuming it created the
file and therefore the perms is not an issue. Another
thing to check if you're not getting any output is if
you've possibly declared "html_file" and/or "unix" for
lengths that are insufficient [since I don't see their
declaration here].)</span><br class="">
<br class="">
<span class="">Also, as Bill and Ken pointed out, the use
of cat is unnecessary since sed just needs to be told
where to get its input. Therefore, simplify with:</span><br
class="">
<br class="">
<span class="">unix="sed 's/XXXXX/"{1{"/g'
</www/template.html >"{html_file</span><br
class="">
<br class="">
<span class="">as Ken pointed out.</span><br class="">
<br class="">
<span class="">Bruce</span><br class="">
<br class="">
<span class="">_______________________________________________</span><br
class="">
<span class="">Filepro-list mailing list</span><br
class="">
<a moz-do-not-send="true"
href="mailto:Filepro-list@lists.celestial.com" class="">Filepro-list@lists.celestial.com</a><br
class="">
<span class="">Subscribe/Unsubscribe/Subscription Changes</span><br
class="">
<a moz-do-not-send="true"
href="http://mailman.celestial.com/mailman/listinfo/filepro-list"
class="">http://mailman.celestial.com/mailman/listinfo/filepro-list</a></div>
</blockquote>
</div>
<br class="">
</div>
</blockquote>
<br>
</body>
</html>