Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

unix script help required for date

Posted on 2013-01-24
2
Medium Priority
?
371 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
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…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

604 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