home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / question / 9400 < prev    next >
Encoding:
Text File  |  1992-07-25  |  1.4 KB  |  42 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!stanford.edu!ames!pan.arc.nasa.gov!rages
  3. From: rages@pan.arc.nasa.gov (kathy rages)
  4. Subject: Re: Redirecting the date as a file name
  5. Message-ID: <1992Jul24.212358.3310@news.arc.nasa.gov>
  6. Keywords: date multiple-spaces
  7. Sender: rages@pan.arc.nasa.gov
  8. Organization: NASA-Ames Research Center
  9. References: <bacon.711843971@odin> <1992Jul24.073019.4230@ericsson.se>
  10. Date: Fri, 24 Jul 1992 21:23:58 GMT
  11. Lines: 29
  12.  
  13.  
  14. In article <1992Jul24.073019.4230@ericsson.se> etxmesa@eos.ericsson.se (Michael Salmon) writes:
  15. >
  16. >From the man page for date:
  17. >
  18. [deleted]
  19. >     encoded by %%.  All other characters are copied to the  out-
  20.                       --------------------------------------------
  21. >     put  without change.  The string is always terminated with a
  22.       --------------------
  23. >     new-line character.
  24. >
  25.  
  26. This gives rise to a question, which I have yet to find an answer to.
  27. How do you force the inclusion of two or more consecutive spaces in
  28. a variable string?
  29.  
  30. % date +%h"  "%d
  31. Jul  24
  32. % set today = `date +%h"  "%d`
  33. % echo $today
  34. Jul 24
  35.  
  36. This has come up in several contexts for me, and I'd like to find out
  37. if it's possible.  (The original context was creating a string to
  38. search for in 'ls -l | grep $today' to find only the files modified
  39. today.  If the day of the month has only one digit, ls puts in two
  40. spaces.)
  41.                                         Kathy Rages
  42.