View previous topic :: View next topic |
Author |
Message |
grj Tux's lil' helper
Joined: 15 Jun 2002 Posts: 96
|
Posted: Fri Aug 02, 2002 12:54 am Post subject: Get current date in bash |
|
|
Is there a way to get the current date in bash?
Then is it possible to format it as yyyy-mm-dd?
Thanks, _________________ Hope this helps!
GRJ |
|
Back to top |
|
|
gfunkmonk Tux's lil' helper
Joined: 10 Jul 2002 Posts: 129 Location: Freelandville, IN
|
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Fri Aug 02, 2002 5:08 am Post subject: |
|
|
Or use Gentoo's own help here. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
ledents n00b
Joined: 15 Jul 2002 Posts: 7
|
Posted: Fri Aug 02, 2002 6:51 am Post subject: |
|
|
just use de date command:
Code: | DATE=`date +"%Y-%m-%d"` |
|
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Fri Aug 02, 2002 4:17 pm Post subject: |
|
|
ledents, well read. For some reason gfunkmonk and I seemed to think he wanted the date in his prompt. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
grj Tux's lil' helper
Joined: 15 Jun 2002 Posts: 96
|
Posted: Sat Aug 03, 2002 12:35 am Post subject: |
|
|
Thanks for the help. I got my script working to download my pictures from my Kodak DC290 using gphoto command line arguments. The scripts checks to see if
~/camera/images/yyyy-mm-dd exists. It it does not the directory is created. After the directory is found to exist or is created the image download to it.
One note: to get the 4 digit year use %Y instead of %y which returns a w digit year.
Thanks, _________________ Hope this helps!
GRJ |
|
Back to top |
|
|
|