<div dir="ltr"><div>what I really need to know is will this:<br><br> make>>make.fail 2>&1<br><br></div>send stderr and stdout to the file 'make.fail' or did I write it incorrectly?<br></div><div class="gmail_extra">
<br clear="all"><div>:-)~MIKE~(-:</div>
<br><br><div class="gmail_quote">On Sun, Aug 24, 2014 at 2:56 PM, Brian Cluff <span dir="ltr"><<a href="mailto:brian@snaptek.com" target="_blank">brian@snaptek.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
the > will delete any file that it points at even if the command doesn't actually output anything. It will even delete the file is the command doesn't exist like if you type grep as gerp >file, file will still be created/overwritten.<br>
<br>
If you want to make sure that your command doesn't overwrite any existing files you have to set the noclobber option like:<br>
$ set -o noclobber<br>
<br>
A good trick to know:<br>
You can use the > to delete the contents of a file without having to delete and recreate the file by simply doing this:<br>
$ >yourfile<span class="HOEnZb"><font color="#888888"><br>
<br>
Brian Cluff</font></span><div><div class="h5"><br>
<br>
On 08/24/2014 02:36 PM, Michael Havens wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
I have a question about redirections:<br>
<br>
make>>make.fail 2>&1<br>
<br>
tells it make and then to send (>) stderr (2) to stdout (1) and also to<br>
send stdout that way also (&1). finally all of that gets sent to a file<br>
named make.fail (>>). Isn't '>>' actually 'append' whereas '>' would<br>
work just as well so long as the file didn't already exist? If the file<br>
did exist would I get an error or would the file be overwritten?<br>
:-)~MIKE~(-:<br>
<br>
<br></div></div><div class="">
------------------------------<u></u>---------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.<u></u>org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/<u></u>mailman/listinfo/plug-discuss</a><br>
<br>
</div></blockquote><div class="HOEnZb"><div class="h5">
------------------------------<u></u>---------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.<u></u>org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/<u></u>mailman/listinfo/plug-discuss</a><br>
</div></div></blockquote></div><br></div>