?
Solved

unix script help required for date

Posted on 2013-01-24
2
Medium Priority
?
369 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 35

Accepted Solution

by:
johnsone earned 2000 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses
Course of the Month11 days, 23 hours left to enroll

752 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