LinuxQuestions.org
Review your favorite Linux distribution.
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, 02: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 02:03 PM.
 
Old 08-20-2004, 02:09 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
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 06:52 PM
Shell script question paraiso Linux - Newbie 2 05-15-2005 01:55 AM
Shell script question... defa0009 Linux - General 7 04-26-2005 08:16 PM
Shell script question. siaful Linux - Newbie 1 04-29-2004 05:01 PM
Shell script question rytrom Linux - Newbie 4 01-28-2004 07:20 AM


All times are GMT -5. The time now is 10:11 PM.

Main Menu
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