DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Create A Daily Notes File Using A Ruby Shell Script

02.05.2010
| 3107 views |
  • submit to reddit
        The following snippet launches a new gedit file with todays date when executed from a bash script.

gedit `ruby -e "puts %q(m/notes%s.txt) % Time.now.strftime('%d%m%y')"`

observed: gedit starts with a new file called notes050210.txt in the ~/m directory.