Solved

unix script help required for date

Posted on 2013-01-24
2
360 Views
Last Modified: 2013-01-26
Hi All,

  I need to pass data values to the weblink below.

For ex:

   If I type the below command @unix prompt:

[appltest@test ~]$ date +"%m-%d-%y"
01-24-13

   I get 01-24-13 and want to pass these values to the below so that daily it takes values of that day and pass it to the weblink.


http://www.tcmb.gov.tr/kurlar/201301/24012013.html

 In the above link, I need to pass year and month after kular/%year%month%/%day%month%year%.html

  So that daily it will pick up with different days and month values like:

If 24-01-13, then weblink should be:

http://www.tcmb.gov.tr/kurlar/201301/24012013.html

If 25-01-13, then weblink should be:

http://www.tcmb.gov.tr/kurlar/201301/25012013.html

and if Feb i.e 04-02-13, then:

http://www.tcmb.gov.tr/kurlar/201302/04022013.html

  Any ideas...Help Appreciated..

Thanks
Aman
0
Comment
Question by:amankhan2005
2 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 38815420
URL="http://www.tcmb.gov.tr/kurlar/$(date +%Y%m/%d%m%Y).html"

echo $URL
0
 
LVL 34

Accepted Solution

by:
johnsone earned 500 total points
ID: 38815433
This would also work:

URL="http://www.tcmb.gov.tr/kurlar/`date +"%Y%m"`/`date +"%d%m%Y"`.html"
echo $URL

I wasn't fast enough, but I had the answer so I thought I would post it anyway.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Utilizing an array to gracefully append to a list of EmailAddresses
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now