home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!stanford.edu!ames!pan.arc.nasa.gov!rages
- From: rages@pan.arc.nasa.gov (kathy rages)
- Subject: Re: Redirecting the date as a file name
- Message-ID: <1992Jul24.212358.3310@news.arc.nasa.gov>
- Keywords: date multiple-spaces
- Sender: rages@pan.arc.nasa.gov
- Organization: NASA-Ames Research Center
- References: <bacon.711843971@odin> <1992Jul24.073019.4230@ericsson.se>
- Date: Fri, 24 Jul 1992 21:23:58 GMT
- Lines: 29
-
-
- In article <1992Jul24.073019.4230@ericsson.se> etxmesa@eos.ericsson.se (Michael Salmon) writes:
- >
- >From the man page for date:
- >
- [deleted]
- > encoded by %%. All other characters are copied to the out-
- --------------------------------------------
- > put without change. The string is always terminated with a
- --------------------
- > new-line character.
- >
-
- This gives rise to a question, which I have yet to find an answer to.
- How do you force the inclusion of two or more consecutive spaces in
- a variable string?
-
- % date +%h" "%d
- Jul 24
- % set today = `date +%h" "%d`
- % echo $today
- Jul 24
-
- This has come up in several contexts for me, and I'd like to find out
- if it's possible. (The original context was creating a string to
- search for in 'ls -l | grep $today' to find only the files modified
- today. If the day of the month has only one digit, ls puts in two
- spaces.)
- Kathy Rages
-