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