Solved

unix script help required for date

Posted on 2013-01-24
2
358 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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…

759 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

21 Experts available now in Live!

Get 1:1 Help Now