LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 08-20-2004, 03:02 PM   #1
swinchen
Member
 
Registered: Apr 2004
Location: Maine (USA)
Distribution: Slackware 9.1
Posts: 45

Rep: Reputation: 15
Shell Script Question


I want to use wget, along with the 'date' command in a script to download a file with the date in the name... for example...

wget -O some_file ftp://username:password@host/file[ date +%y%m%d ].txt


where the command inside the brackets is executed... I dont know what this is called, but after it is executed it would look like this:

ftp://username:password@host/file040820.txt


#!/bin/bash

wget..... dont know how to do it....

Thank for any help.

Sam

Last edited by swinchen; 08-20-2004 at 03:03 PM.
 
Old 08-20-2004, 03:09 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
This is one way:

wget -O some_file ftp://username: password@host/file`date +%y%m%d`.txt

Or, using a variable:

DATE="`date +%y%m%d`"
wget -O some_file ftp://username: password@host/file${DATE}.txt


Hope this gets you going again.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script question Whiteghost Programming 17 09-10-2005 07:52 PM
Shell script question paraiso Linux - Newbie 2 05-15-2005 02:55 AM
Shell script question... defa0009 Linux - General 7 04-26-2005 09:16 PM
Shell script question. siaful Linux - Newbie 1 04-29-2004 06:01 PM
Shell script question rytrom Linux - Newbie 4 01-28-2004 08:20 AM


All times are GMT -5. The time now is 08:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration