Sponsored Content
Top Forums Shell Programming and Scripting Assign value to a variable in a parameter file Post 75775 by gopskrish on Wednesday 22nd of June 2005 05:35:56 AM
Old 06-22-2005
Assign value to a variable in a parameter file

Hi,

I have a parameter file and it contains following items
$ cat TransactionParams
From_Date_Parm=2005-02-25
To_Date_Parm=2005-05-25
Extract_Root_Parm=/detld1/etl/ascential/Ascential/DataStage/Projects/CTI_London/IAM
Extract_Type_Parm=Transaction
EDW_Database_Parm=hdw_erks
EDW_User_Parm=t449206
FTP_Path_Parm=/detld1/etl/ascential/Ascential/DataStage/Projects/CTI_London/IAM/ftp/
FTP_User_Parm=t449207
FTP_Password_Parm=Magdog,123
Date_Run_Parm=06042005
Sequence_ID_Parm=1
Daily_Sequence_Parm=1
ParameterFileParm="nothing"
Send_FTP_Parm=Y


What i should do is i need to write a script which should search for systemtime (based on the time we run) and if it is less than 12'0 clock then From_Date_Parm should be replaced with sysdate - 1 (2005-06-20) and To_Date_Parm as sysdate (2005-06-21) else if it is greater than 12 and less than 24 then From_Date_Parm = sysdate (2005-06-21)

How can i change the appropriate values using script.
I am new to unix and i want the code which does the corresponding job.

Thanks in advance.

cheers,
gops
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to Read a config file and Assign to Variable

I have removeConfig file, it contains the dir paths for removing. I need to read line by line and assign to variable. any idea? (1 Reply)
Discussion started by: redlotus72
1 Replies

2. UNIX for Dummies Questions & Answers

search file for word, then assign to variable

Hi all, Trying to search a file for one word only, then assign that word to a variable. Not sure if this is a grep or awk (or either) function. Should be a simple operation. Example: This file contains the string "COMPLETE". I would like to pull that word out and assign it to a... (2 Replies)
Discussion started by: dejit
2 Replies

3. Shell Programming and Scripting

how to check a word in a file and assign to a variable

Hi; I'm a newbie in UNIX, would appreciate for the help. I have a unix oracle script (lets call it orcl.sh) The scripts does a login via sqlplus and does some DDL. The orcl.sh script spool the output of the DDL into orcl.log The orcl.sh is executed via another script call A.sh. It is call... (1 Reply)
Discussion started by: hippo2020
1 Replies

4. UNIX for Dummies Questions & Answers

How to assign the content of a file to a variable?

Hi all, I have a problem here. I have a file and let we take the content of the file is just '32' (only a numeric value in that file). Now I need to assign this numeric value ( value in that file) to a variable. Is that possible? If so, can you plz advice me on this? Thanks in... (4 Replies)
Discussion started by: iamgeethuj
4 Replies

5. Programming

Can't assign struct variable in header file

Hi guys. I have a header file including a structure like this: typedef struct { int index = -1; stack_node *head; } stack; But when compiling with cc it shows error at the assignment line (int index = -1): error: expected ‘:', ‘,', ‘;', ‘}' or ‘__attribute__' before ‘=' token... (1 Reply)
Discussion started by: majid.merkava
1 Replies

6. Shell Programming and Scripting

How to assign a shell variable to a NUMBER parameter in pl/sql?

I have the below script running for generating file from PL/SQL stored procedure. I need to declare a shell variable and then pass this to sqlplus command to pass the same as a INPUT parameter for the stored procedure. Please help to do this. #!/bin/sh minlimit=0 maxlimit=10 size=100 while... (0 Replies)
Discussion started by: vel4ever
0 Replies

7. Shell Programming and Scripting

How can we assign value to an array variable from an external file?

is it possible to assign value to an array variable from an external file?? if yes then how?? I am using below code but its not working. #!bin/bash myarray < file_name echo ${mayarray} (6 Replies)
Discussion started by: mukulverma2408
6 Replies

8. Shell Programming and Scripting

Assign a variable to number of lines in a file

Hello Gurus, Here is my requirement. I need to find the number of lines in a file and need to assign it to a variable. This is what I did and not wroking. #!/bin/ksh set -xv Src_Path=/mac/dev/Generic/SrcFiles Src_Count=wc -l ${Src_Path}/FILE_JUNE.txt Count_file = $Src_Count | awk -F... (2 Replies)
Discussion started by: thummi9090
2 Replies

9. UNIX for Dummies Questions & Answers

Assign line from file to variable

Hi, I am new to shell scripting. Need help with the below requirement. I need help to read a log file and line containing word ORA needs to be captured into a variable and the values of the variable need to be inserted into a table. For E.g. file test.sql has below error: ORA-01017:... (3 Replies)
Discussion started by: ricsharm
3 Replies

10. Shell Programming and Scripting

Assign variable value from file to another with the same name

Hi All, I need to read two config files in a shell script. In that I need to assign a value from one config file to another. I 'm using bash. config_env.txt prefix=tab_ config_properties.txt table_name=${prefix}account So, when I read these two files in a shell script, I need... (6 Replies)
Discussion started by: shash
6 Replies
FINDDUP(1)							       Perl								FINDDUP(1)

NAME
finddup - Find identical files and do something with them SYNOPSIS
Usage: finddup [options...] --man the manpage -h, --help a short help --version the version (CVS) of the program -n, --noaction do just nothing, just print out (implies -v) -v, --verbose just what the name says -q, --quiet be quiet -l, --link link the identical files together -o, --oldresult Use the old output of this script -i, --ignore-perms Don't check that file owner and permissions match -d, --dir Define the dir to check (you may specify more than one) DESCRIPTION
finddup search the working directory and all files below on the same partition for duplicate files. finddup can optional hardlink such files to save space. Files size 0 will not be reported or hardlinked as this might give problemes later. This is a complete rewrite of the finddup in perl to handle several issues: - Allow spaces and other characters in filenames - be faster - include nodup in same script - Handle files that already have other hardlinks in the same tree - Several improvements If started as nodup or nodup.pl the script will act like started with options --link and --oldresult COPYRIGHT
Copyright (c) 2005 by Klaus Ethgen. All rights reserved. LICENSE
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. AUTHOR
Klaus Ethgen <Klaus@Ethgen.de<gt> HISTORY
$Log: finddup,v $ Revision 2.3 2005/02/06 18:57:42 klaus * Make --oldresult faster by not calculating the md5sum again * Fix a but that with --oldresult no links will be done cause the internal datastructure * Do handle errors in open for md5sum calculation Revision 2.2 2005/02/06 12:21:02 klaus Little but important bug in link routine. Revision 2.1 2005/02/05 18:43:11 klaus Just cosmetic Revision 2.0 2005/02/05 18:41:20 klaus Completely new version Contributed User FINDDUP(1)
All times are GMT -4. The time now is 01:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy