Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error: Not found for variable

Status
Not open for further replies.

babeo

Technical User
Mar 30, 2000
398
CA
Hello,
I have a script working background to ftp files from dirA to another server and process it, and it working fine.

Now, I copy that script to another name, and change the dirA to dirB and run manually, and I get error below. I don't know why, could someone help please? Thanks

Notify that, both scripts are run at Korn shell.

[red]get_convert[19]: 20050110: not found[/red]

where '20050110' is just a variable set as:
$GET_DATE = '20050110'

Thanks
 
Replace this:
$GET_DATE = '20050110'
By this:
GET_DATE='20050110'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Oops,
Sorry I should type more carefully.
Yes, I set the variable as GET_DATE='20050110' beside, I said I copy the script to another name and only change the directory and the date to '20050110' only, nothing else is changed.
Is there any idea?
Thanks
 
Any chance you could post the contents of the get_convert script ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
[blue] #!/bin/ksh
# .... after the 1st line above, is only the lengthly comment lines to descript about this script. I cut them off.
# For counting the line number, the below is line 19th per error message indicates
GET_DATE=`20050110`

# specify parameters for FTP connection with the next structure:
# correspondence line, where "" quote to explain the variable/data in the command line below it:
# "CONNECTION NAME"="LOCAL FOLDER NAME" "IP" "USER ID" "PASSWORD" "PATH" "FILE NAME"

LCM40="lcm40xin 192.25.xxx.xx babeo mypassword /data/vancouver/archives/lcm40xin [green]lcm_$GET_DATE*[0-9][/green]"
.....[/blue]

After the ftp above, the data is ftped to the directory /data/vancouver/archives/lcm40xin (original directory is /data/vancouver/lcm40xin), the file names is lcm_1to8.log-20050110[red]0839[/red].pro, then the rest of the script is only calling other procedures and do the work (without any substitution of the GET_DATE variable).

As you see, the data files are only different in the red part. So, I did try with [green]lcm_$GET_DATE*[0-9].proc[/green] too, but I have the same error message.

Thanks
 
So, replace the back-ticks by single quotes, ie,
Replace this:
GET_DATE=`20050110`
By this:
GET_DATE='20050110'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks PHV

I found the problem! Thanks for your help any way.
I must do a horrible mistake of cp.
It actually works for [green]lcm_$GET_DATE*[0-9].proc [/green] instead of lcm_$GET_DATE*[0-9], as I indicated above, however since it still displays the error (don't know why), I did not check for process, until I check the new directory and see the data is there, and so I check the process and see it's running!
Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top