Get command with variables


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Get command with variables
# 1  
Old 12-01-2009
Network Get command with variables

I'm writing a script to get a datestamped file from a ftp server. It seems that the "get" command does not respect variables. Anyone knows how to fix the problem?

I'm trying to get a file named "rcsnotesYYYYMMDD"

Here's my script

Code:
today=`date +%Y%m%d`
tput clear
user <login> <password>
prompt
#
lcd /epic/phs/edi/vendnotes/rcsnotes
cd /home/ftp/rcs/inbound/work
#
get rcsnotes$today
sleep 5
#
#mdelete rcsnotes*
#
bye

I've also tried rcsnotes${today} rcsnotes$(`date +%Y%m%d`)

Last edited by pludi; 12-01-2009 at 02:28 PM..
# 2  
Old 12-01-2009
The get command does not accept variables. For that you have to use the case, nmap or ntrans commands before using the get command. It is all documented in the ftp man page.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Using find command with variables

I have a number of files in the /tmp directory with PET-DOG in their name. I want to delete them, leaving only files with PET-CAT and PET-HORSE. I'd like to use the find command to locate those files (by using a variable) and then I'd like to delete them. However, I can't find a way to do this. I... (3 Replies)
Discussion started by: newbie2010
3 Replies

2. UNIX for Dummies Questions & Answers

Use variables for cut command

#!/bin/sh I have a file matrix.pair.cols that contains numbers like shown below: case1 17 18 case2 1 2 case3 4 5 case4 .. .. I want to cut the column numbers mentioned in col2 and 3 from another file I have tried the code below, but no avail. #!/bin/sh while read p q r do... (5 Replies)
Discussion started by: Gussifinknottle
5 Replies

3. Shell Programming and Scripting

Need help with paste command using variables

How can I accomplish this? I basically want to merge two variables onto the same line. I can do it with two FILES this way: $ cat /tmp/users_in.list | awk -F "," '{print $2}' | cut -c -1 > first.initial $ awk -F "," '{print $1}' /tmp/users_in.list | awk '{print $1}' > last.name $ paste... (5 Replies)
Discussion started by: greenlightening
5 Replies

4. Shell Programming and Scripting

Variables in an awk command

I am scripting a process where usernames are added to the end of a specific line in a file. using this: awk 'NR==1{$NF=$NF" TEXT"}1' myfileworks, and then I would use > tempfile && mv tempfile myfile HOWEVER. Being that this is to be scripted, I am trying to do something like: awk:... (8 Replies)
Discussion started by: magicjoe
8 Replies

5. UNIX for Dummies Questions & Answers

Command expansion and variables

Command expansions are pretty useful in some situations, however, I am not understanding why expansions do not update files, folders, directories, or even the current time, when there are placed in variables. For example: #create variable d=$(date) result echo $d Fri Jun 14 15:48:04... (8 Replies)
Discussion started by: BrandonD
8 Replies

6. Shell Programming and Scripting

Variables in SED command

Hi all, I want write a script to display 5rows at times from a input file. my out like: echo " display started" r1 r2 r3 r4 r5 ... Some action items... again i need next 5 lines. can you please advise. (2 Replies)
Discussion started by: koti_rama
2 Replies

7. Shell Programming and Scripting

command paste with variables

Hi. I have an interesting problem and i couldn't find out the solution. I have two variables in which there are a lot of lines finished by \n. I would like to concatenate this two variables into one in this format: var1var2 var1var2 . . . I could do this simply by command paste but it works... (32 Replies)
Discussion started by: samos
32 Replies

8. Shell Programming and Scripting

assign a command line argument and a unix command to awk variables

Hi , I have a piece of code ...wherein I need to assign the following ... 1) A command line argument to a variable e.g origCount=ARGV 2) A unix command to a variable e.g result=`wc -l testFile.txt` in my awk shell script When I do this : print "origCount" origCount --> I get the... (0 Replies)
Discussion started by: sweta_doshi
0 Replies

9. Shell Programming and Scripting

Multiple variables from one command

I have the following bit of code FOUND_SEC=`ls -ld $NAME 2>/dev/null|awk '{print $1}'` FOUND_USER_NAME=`ls -ld $NAME 2>/dev/null|awk '{print $3}'` FOUND_GROUP=`ls -ld $NAME 2>/dev/null|awk '{print $4}'` is there a better way to write it to get the same result as it seems... (2 Replies)
Discussion started by: sjday
2 Replies

10. UNIX for Dummies Questions & Answers

scp command and variables

Hi all, I need a help. I'm trying to do this command in a shell script: `su -l accenture -c '/usr/bin/scp ${SCP_IN}/*.csv ${ORACLE_USER}@${ORACLE_IP}:${ORACLE_DIR}'` but I obtain a no connection error. If I explicit variables, It works. Why? I need use variables in this command. ... (2 Replies)
Discussion started by: idro
2 Replies
Login or Register to Ask a Question