home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / question / 9360 < prev    next >
Encoding:
Internet Message Format  |  1992-07-23  |  1.4 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!usc!wupost!gumby!destroyer!ncar!hsdndev!marby
  2. From: marby@laura.harvard.edu (Craig Marby)
  3. Newsgroups: comp.unix.questions
  4. Subject: Re: Redirecting the date as a file name
  5. Message-ID: <MARBY.92Jul23164959@laura.harvard.edu>
  6. Date: 23 Jul 92 20:49:59 GMT
  7. References: <bacon.711843971@odin>
  8. Sender: usenet@hsdndev.UUCP
  9. Organization: Chemistry Dept., Harvard University
  10. Lines: 30
  11. In-reply-to: bacon@odin.unomaha.edu's message of 22 Jul 92 22:26:11 GMT
  12.  
  13. >>>>> On 22 Jul 92 22:26:11 GMT, bacon@odin.unomaha.edu (Melissa Bacon) said:
  14.  
  15. >> I'm setting up a .logout file that shows files that I have edited or
  16. >> added in the past day.  So far, so good.  This was no problem.  However,
  17. >> now what I want to do is to take the system date and tee my list of
  18. >> files to another file with the date (  date | cut -c5-10 ) as the
  19. >> filename.  How can I redirect the output of that command and use it to
  20. >> create a filename (for example, today's file should have the name
  21. >> 'Jul 22' ?  Is it possible to save the output as a string which then
  22. >> could be outputted as the filename?
  23.  
  24. >> Thanks for any and all help.
  25.  
  26. >> Melissa
  27.  
  28.  
  29. How about
  30.  
  31. #!/bin/csh
  32. set output = `date +%b%d`   # note ` quote used
  33. #  above sets output to eg Jul23 -- see `man date` for other possibilities
  34. ls -l * > $output
  35.  
  36. The above should do the trick
  37. --
  38.  
  39.     __o         
  40.   _ \<,_       Craig A. Marby    marby@layla.harvard.edu
  41.  (_)/ (_)      
  42. ~~~~~~~~~~
  43.