making unique file names

Michael Havens bmike1 at gmail.com
Mon Apr 6 21:10:45 MST 2015


I am writing someone a letter. He has script that runs apt-get update/grade
in one swoop. Something happened once and he needed to see what files had
upgraded but because nothing print to screen he had no idea which files
did. Could someone tell me if I am telling it correctly? In the unfinished
paragraph I am unsure how to finish it. What I want to do is prepend 'file'
with the date. How is it done?
Here is the letter:

you know wiz, you might want to make your script print the output of
update/upgrade to a file in case something like this happens again and you
need to see what it did. You do this by typing:


   sudo apt-get update > file

   sudo apt-get upgrade >> file


If you want it to print any errors that may have scrolled by to the file
you'll have to pre-pend the carrots with '&2' to make it look like this:


   sudo apt-get update &2> file

and

   sudo apt-get upgrade &2>> file


I'm pretty sure that is how it is done at least. I wouldn't worry about
making 'file' unique for each time you run it as you'll never look at it
unless there is a problem. If you really want to do that
:-)~MIKE~(-:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phxlinux.org/pipermail/plug-discuss/attachments/20150406/8f55ef63/attachment.html>


More information about the PLUG-discuss mailing list