<div dir="ltr">Okay, I wasn&#39;t sure if that would work or not since I was running the internal script as a different user.  Thanks.<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 21, 2013 at 10:11 AM, Reindl Harald <span dir="ltr">&lt;<a href="mailto:h.reindl@thelounge.net" target="_blank">h.reindl@thelounge.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
Am <a href="tel:21.08.2013%2016" value="+12108201316">21.08.2013 16</a>:04, schrieb Mark Haney:<br>
<div class="im">&gt; I&#39;ve got a bash script that has two parts.<br>
&gt;<br>
&gt; 1. runs a script as a different user (using su &lt;username&gt; -c &lt;script&gt;)<br>
&gt; 2. when that part finishes, the script does a copy of the files created to another directory<br>
&gt;<br>
&gt; I want to log the output of the entire script into one file.  I.e.:<br>
&gt;<br>
&gt; internal script&gt;external script&gt; logfile<br>
&gt;<br>
&gt; What&#39;s the best way to do this?  I can clarify, I hope, I&#39;ve edited this a dozen times to get what I want in as<br>
&gt; clear a message as possible<br>
<br>
</div>why do you think you need to care about the internal called one?<br>
you call wathever and say &quot;redirect my output&quot;, that belongs to<br>
*anything* called by this script with the only eception of stderr<br>
<br>
command 2&gt;&gt; logfile.txt &gt;&gt; logfile.txt<br>
<br>
&gt;&gt; is &quot;do not make the file empty, add your output at the end&quot;<br>
&gt; would empty any existing file before<br>
___________________________________________<br>
<br>
[harry@rh:~/Desktop/test]$ cat script1.sh<br>
#!/usr/bin/bash<br>
echo &quot;OUTPUT SCRIPT 1&quot;<br>
bash ./script2.sh<br>
<br>
[harry@rh:~/Desktop/test]$ cat script2.sh<br>
#!/usr/bin/bash<br>
echo &quot;OUTPUT SCRIPT 2&quot;<br>
<br>
[harry@rh:~/Desktop/test]$ ./script1.sh<br>
OUTPUT SCRIPT 1<br>
OUTPUT SCRIPT 2<br>
<br>
[harry@rh:~/Desktop/test]$ ./script1.sh &gt; output.txt<br>
<br>
[harry@rh:~/Desktop/test]$ cat output.txt<br>
OUTPUT SCRIPT 1<br>
OUTPUT SCRIPT 2<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Caesar si viveret, ad remum dareris.<br><br>Mark Haney<br>Software Developer/Consultant<br><a href="mailto:mark.haney@gmail.com" target="_blank">mark.haney@gmail.com</a>
</div>