Decrement using bash!!
Hi all,
Thanks in Advance! I want a simple script to print today and yesterdays date. using this command Code:
date +%d%m%Y so i tried using simple decrement operator Code:
#!/bin/bash |
The date command is very flexible. You can just:
Code:
date -d 'yesterday' '+%d%m%Y' |
Quote:
OP, you don't ever seem to be doing any research on how to write scripts for yourself, or do any research on how to solve your own problems, but want people to write them for you: http://www.linuxquestions.org/questi...e-line-901450/ http://www.linuxquestions.org/questi...ng-awk-896800/ http://www.linuxquestions.org/questi...script-896608/ http://www.linuxquestions.org/questi...ectory-894137/ Don't mean to sound nasty, but being spoon-fed every answer isn't a good way to learn. And you've been on LQ for over a year...'newbie' doesn't apply anymore. |
Hi TB0ne,
Thanks for your kindful words, i dont feel ashame never ever!! i know my values and goals, as a senior member i didnt expect from you, words are most harmful than bullets..hmmm days are not to far to become master in linux domain, Thanks for your Praising words. |
Quote:
Again, I really am NOT trying to be nasty, but asking others to write your scripts or read man pages for you, isn't a good way to learn. Experiment. Try different things, and read/understand the errors, and move forward. THAT will get you knowledge. |
All times are GMT -5. The time now is 06:58 AM. |