Sponsored Content
Full Discussion: Get command with variables
Top Forums UNIX for Dummies Questions & Answers Get command with variables Post 302376490 by mliu3 on Tuesday 1st of December 2009 01:18:57 PM
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..
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
Date::Manip::Migration5to6(3)				User Contributed Perl Documentation			     Date::Manip::Migration5to6(3)

NAME
Date::Manip::Migration5to6 - how to upgrade from 5.xx to 6.00 SYNOPSIS
When upgrading from Date::Manip 5.xx to 6.00, a few changes may be necessary to your scripts. The Date::Manip::Changes5to6 document lists in more detail the ways in which Date::Manip changed, but very few of these actually entail changes to your script. It should be noted that once the changes are made to your script, it will no longer run correctly in 5.xx. NECESSARY AND SUGGESTED CHANGES
The following changes are necessary, or strongly suggested: Reading config files with Date_Init If you use Date_Init to read any config files (if you do business mode calculations, you probably do), you should remove all of the following config variables from your call to Date_Init: GlobalCnf=FILE PersonalCnf=FILE PathSep=* IgnoreGlobalCnf=* PersonalCnfPath=* and replace them with: ConfigFile=FILE where FILE is now the full path to a config file. Also, the ConfigFile argument should be the first argument in Date_Init. Date_ConvTZ The Date_ConvTZ function has changed. It should now take 3 arguments: $date = Date_ConvTZ($date,$from,$to); If $from is not given, it defaults to the local time zone. If $to is not given, it defaults to the local time zone. The date is converted from the $from time zone into the $to time zone. Both should be any time zone (or alias) supported by Date::Manip. The old $errlevel argument is no longer handled. ConvTZ and TZ config variables If you use either the ConvTZ or TZ config variables, you should replace them with either SetDate or ForceDate. See the Date::Manip::Config document for information. The TZ variable will continue to work until Dec 2013 at which point it will be removed. Other deprecated config variables The following config variables have been deprecated, but will continue to function (though they will be removed at a future date): TZ (removed Dec 2013) The following variables have been removed. If you use any of them, you may need to modify your scripts: IntCharSet GlobalCnf PersonalCnf PathSep IgnoreGlobalCnf PersonalCnfPath ConvTZ Internal TodayIsMidnight DeltaSigns UpdateCurrTZ ResetWorkdDay today, yesterday, tomorrow If you parse the strings "today", "yesterday", or "tomorrow" in order to get the time now, or 24 hours in the past/future, this will no longer work. These strings now refer strictly to the date (so "today" is the current day at midnight, "yesterday" is the previous day at midnight, etc.). To get the time now, 24 hours ago, or 24 hours in the future, you would need to parse the strings "now", "-24:00:00", or "+24:00:00" respectively. Do not use Memoize In 5.xx, it was documented that you could use the module Memoize to speed up Date::Manip, especially when sorting dates. This information is no longer accurate. Using Memoize in conjunction with Date::Manip should have little impact on performance, and may lead to incorrect results, especially if you change config variables. Please see the Date::Manip::Changes5to6 (GENERAL CHANGES) document for more information. If you find other instances where it is necessary to modify your script, please email me so that I can add that information to this document. BUGS AND QUESTIONS
Please refer to the Date::Manip::Problems documentation for information on submitting bug reports or questions to the author. SEE ALSO
Date::Manip - main module documentation LICENSE
This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself. AUTHOR
Sullivan Beck (sbeck@cpan.org) perl v5.16.3 2014-06-09 Date::Manip::Migration5to6(3)
All times are GMT -4. The time now is 08:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy