The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
error while using export command Amit.Sagpariya Shell Programming and Scripting 1 11-11-2008 02:06 AM
awk/sed Command : Parse parameter file / send the lines to the ksh export command rajan_san Shell Programming and Scripting 4 11-06-2008 01:29 PM
Export command prakash.kudreka UNIX for Advanced & Expert Users 3 11-20-2007 08:37 AM
export command radhika03 UNIX for Dummies Questions & Answers 2 12-16-2005 09:25 AM
using export command sveera Shell Programming and Scripting 4 04-01-2005 11:05 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-26-2009
chpraveen_862 chpraveen_862 is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 1
Export Command

Hello All,

I am transferring a file from one server to another server.
File name is stored as Wip_DD-MM-YY .i.e if we run the program today the file is stored as Wip_18-FEB-09.txt.
This file i need to transfer.

My question is how do we assign the this filename to a variable.

i treid in the following way

export MYFILE=wip_`date +%d-%b-%y.txt`

ftp -v -n testone << EOF
user user_name pass_Word
cd /D01/tl/Test/outbound
ascii
get $MYFILE
bye
EOF


But i am getting error as follows Wip_18-Feb-09.txt: is not an identifier.
Also i would like get the month name as FEB not as feb.

Please let me know

Kind Regards,
Praveen
  #2 (permalink)  
Old 02-26-2009
salil2012 salil2012 is offline
Registered User
  
 

Join Date: Feb 2009
Location: India
Posts: 45
look at this:

I couldn't understand ur problem exactly but as i unserstand it is.........
use this:
export MYFILE=`date +%d-%m-%y`

and

echo wip_$MYFILE

Hope! it wll work.
and reply to this foram if it works
  #3 (permalink)  
Old 02-26-2009
radoulov's Avatar
radoulov radoulov is offline Forum Staff  
addict
  
 

Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 2,847
Quote:
[...]
But i am getting error as follows Wip_18-Feb-09.txt: is not an identifier.
Try changing this:

Code:
export MYFILE=wip_`date +%d-%b-%y.txt`
to:

Code:
MYFILE=wip_`date +%d-%b-%y.txt` export MYFILE
  #4 (permalink)  
Old 03-19-2009
uniesh uniesh is offline
Banned
  
 

Join Date: Mar 2009
Posts: 16
if [ `hostname` = <server> ]
then
echo `date`
echo Sending file to <another server>
ff="wep_`date +%Y%m%d`"
echo "
user UN Passwd
get $ff
quit
" | ftp -n <server name>
fi



should you use Export command ....let me know......
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:23 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0