Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Overwrite a Source Script Variable Value Post 302820945 by Ariean on Thursday 13th of June 2013 05:11:25 PM
Old 06-13-2013
Overwrite a Source Script Variable Value

Hello All,
How do i overwrite a sourced script variable value.

Sourced Script:
Code:
GEN_PARAM_LIST4=""$LOG_DIR"/dwh_GenerateXMLFile.lst"
GEN_PARAM_LIST4_v2=""$LOG_DIR"/dwh_GenerateXMLFile.v2.lst"

I am using below statement for replacing.
Script2:
Code:
[ ! -z ${UNINUM} ] && "${GEN_PARAM_LIST4}"="${GEN_PARAM_LIST4_v2}"

Error:
Code:
/home/infrmtca/bin/dwh_GenerateXMLFile.sh: line 204: /home/infrmtca/bin/log/dwh_GenerateXMLFile.lst=/home/infrmtca/bin/log/dwh_GenerateXMLFile.v2.lst: No such file or directory

---------- Post updated at 05:11 PM ---------- Previous update was at 05:06 PM ----------

I think i got it but not sure if this is right approach.

Code:
[ ! -z ${UNINUM} ] && GEN_PARAM_LIST4="${GEN_PARAM_LIST4_v2}"

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

a script to clone a dir tree, & overwrite the dir struct elsewhere?

hi all, i'm looking for a bash or tcsh script that will clone an empty dir tree 'over' another tree ... specifically, i'd like to: (1) specify a src directory (2) list the directory tree/hiearchy beneath that src dir, w/o files -- just the dirs (3) clone that same, empty dir hierarchy to... (2 Replies)
Discussion started by: OpenMacNews
2 Replies

2. Shell Programming and Scripting

Overwrite a running shell script

Hello all, This might be a dumb question...but i am running into this situation. I have a shell script that is currently in running state. It has big sql's in it and will run for few days. What happens if I change the shell now? Eg: a.shl is running and i want to mv b.shl a.shl I... (5 Replies)
Discussion started by: gsjdrr
5 Replies

3. Shell Programming and Scripting

how to source csh script in tcl script

i have atcl script and i want to source a csh script to reflect changes done by script ........ Please help....... (0 Replies)
Discussion started by: paragarora47
0 Replies

4. Shell Programming and Scripting

Source environment variable in script

Hi, I construct a bash script to finish some tasks. One of the task is to set up some environment variables. There is already one script file to complete the environment variables setting work. I am not able to know the detail of how to set these variables. So, I may just need to call this... (4 Replies)
Discussion started by: gofortime
4 Replies

5. Shell Programming and Scripting

Need to overwrite shell script using vi editor

I have an existing shell script that I am trying to modify. I have about 10 lines of info I want to overwrite using text someone emailed to me. I guess what I am trying to do basically is like a copy/paste, but it's not working for me. I am using Cygwin and vi editor. I open the script and... (4 Replies)
Discussion started by: kimberlyg2007
4 Replies

6. Shell Programming and Scripting

Shell script to overwrite a file

Hi Guys, My requirement as follows, i want to write a shell script to display the files of a folder, i export it to a file to mail the file. The problem is the exported file is getting appended every time I run the script. I just want the file to be over written. can anyone suggest?? ... (4 Replies)
Discussion started by: Karthick N
4 Replies

7. Shell Programming and Scripting

Script to overwrite & before that keep copy a file on many servers

I have ssh password less auth enable & script does the job well as well #/bin/bash for i in `cat ip` do scp /etc/resolv.conf root@$ip done But I need to take backup of the file i will overwrite .. is there any simple way ? Kindly respond (5 Replies)
Discussion started by: heman96
5 Replies

8. Shell Programming and Scripting

Source functions from variable

I have a functions file containing functions: file.functions: myTest () { echo "MYPWD=$(echo $(pwd))" echo "MYLOGNAME=${LOGNAME}" } myCar () { echo "MYDATE=$(date)" echo "MYUPTIME=$(uptime)" } i know i can source this file in another script using something similar to this: source... (8 Replies)
Discussion started by: SkySmart
8 Replies

9. Shell Programming and Scripting

Source functions from variable

so i found a way to do this. #!/bin/bash MYF=$(/home/jason/myfunctions) source <(printf '%s\n' "${MYF}") echo "${var1}" /home/jason/myfunctions is a script that outputs information..i.e. functions...etc that needs to be sourced. I have no control over /home/jason/myfunctions. i can... (3 Replies)
Discussion started by: SkySmart
3 Replies
Jifty::Script::Model(3pm)				User Contributed Perl Documentation				 Jifty::Script::Model(3pm)

NAME
Jifty::Script::Model - Add a model class to your Jifty application SYNOPSIS
jifty model --name MyFirstModel jifty model --name MyFirstModel --force Options: --name <name> name of the model --force overwrite files --help brief help message --man full documentation DESCRIPTION
Creates a skeleton model file. options --name NAME (required) Name of the model class. --force By default, this will stop and warn you if any of the files it is going to write already exist. Passing the --force flag will make it overwrite the files. --help Print a brief help message and exits. --man Prints the manual page and exits. DESCRIPTION
This creates a skeleton of a new model class for your jifty application, complete with a skeleton of a test suite for it, as well. METHODS
run Creates a skeleton file under "lib/ApplicationClass/Model/Model", as well as a skeleton tests file. DESCRIPTION
A basic test harness for the $model model. perl v5.14.2 2010-09-25 Jifty::Script::Model(3pm)
All times are GMT -4. The time now is 04:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy