Failed to concatenate parameter in k-shell


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Failed to concatenate parameter in k-shell
# 1  
Old 05-23-2005
Failed to concatenate parameter in k-shell

Hi folks,

I'm trying to concatinate a time zone offset parameter to the word "GMT" and i failed.
I have the following function:
update_opmn_xml()
{
echo "\nChecking opmn.xml ..."

## Calculating timezone offset
calc_timezone_offset
echo ${TzOffset}
export opmnXml=/tmp/opmn.xml
grepOpmn="ias-instance"
lineNum=`grep -n ${grepOpmn} ${opmnXml} | awk -F: '{print $1}'`

string='<java-option value="-Drightv.root=${ORACLE_HOME}/j2ee/OC4J_RiGHT
v_${SCHEMA_NAME} -Xmx512M -Duser.timezone=GMT${TzOffset}"/>'
echo "#!/bin/ksh
ed -s ${opmnXml} <<EOF >/dev/null
${lineNum}
a
${string}
.
w
q
EOF" > /tmp/subED_1 && chmod 755 /tmp/subED_1 && /tmp/subED_1
}

The value of the parameter ${TzOffset},wgich calculated in the function calc_timezone_offset is: +03:00

In the edited file ,opmn.xml ,the following line was appended:
<java-option value="-Drightv.root=/home/ias/v9.0.3/j2ee/OC4J_RiGHTv_FOO
-Xmx512M -Duser.timezone=GMT"/>

As you can see,the value of the parameter ${TzOffset} was not concatinated.
Maybe the "+" sign made the problem?

Please advice.
Thanks in advance,
Nir
# 2  
Old 05-23-2005
Meanwhile,I solved my problem by changing the parameter "string"
from :
string='<java-option value="-Drightv.root=${ORACLE_HOME}/j2ee/OC4J_RiGHT
v_${SCHEMA_NAME} -Xmx512M -Duser.timezone=GMT${TzOffset}"/>'

to :
string="<java-option value=\"-Drightv.root=${ORACLE_HOME}/j2ee/OC4J_RiGHTv_${SCHEMA_NAME} -Xmx512M -Duser.timezone=GMT${TzOffset}\"/>"

Changing the inverted commas (') to quotation marks (") and adding back slash (\) before some quotation marks.

Regards,
Nir
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

C shell concatenate string doesn't work

I have the following code: #!/bin/csh clear set cloud_file="/home/labs/koren/davidsr/general_scripts/MFP_10_PP_Parmas.txt" # to fill set mie_tables_dir='/home/labs/koren/davidsr/SHDOM_MAIN/MIE_TABLES/non_polo_wave_0.7_water_50R_s0.5_e25_max_70.mie' # to fill set prp_dir='${pp_dir}/pp_prp/'... (2 Replies)
Discussion started by: student_wiz
2 Replies

2. Shell Programming and Scripting

Passing a command shell parameter to another shell

Good afternoon, i need your help pls I want to write a new script that start running as soon as a previus one finish via Autosys (it should be implemented via Autosys too to validate the exsitance and the successful transfered file to a remote server Whenever the file arrives to the path... (2 Replies)
Discussion started by: alexcol
2 Replies

3. UNIX for Advanced & Expert Users

Concatenate output in shell script

Hi Colleagues, I need the help in the followind. I execute this. select count(*) from schema.tablew the output is this. select count(*) from schema.table 3955 I need the followind output. select count(*) from schema.table 3955 Thank you for you help. (8 Replies)
Discussion started by: systemoper
8 Replies

4. UNIX for Advanced & Expert Users

Concatenate lines in file shell script

Hi colleagues, I have a file in this format. "/cccc/pppp/dddd/ggg/prueba.txt". ERROR" THE error bbbbbbbbbb finish rows. "/kkkk/mmmm/hhhh/jjj/ejemplo.txt". ERROR This is other error rows.I need my file in this format. "/cccc/pppp/dddd/ggg/prueba.txt". ERROR" THE error bbbbbbbbbb finish rows.... (3 Replies)
Discussion started by: systemoper
3 Replies

5. Shell Programming and Scripting

Need to create concatenate the shell variable with file content

Hi Guys, I have a file. Each record needs to inserted into a table. The table also have other columns which needs to be inserted with Shell variables. The following is the file. Error code None. Error Code 1 The shell script is having these variables. Name=Magesh Dep=Coding ... (1 Reply)
Discussion started by: mac4rfree
1 Replies

6. Shell Programming and Scripting

concatenate lines using shell scripting

i have a mega file in this format: a, b, c, d, = a2, b2, c2, d2, = a3, b3 = i want to combine lines until = meet. the result should be : a,b,c,d, a2,b2,c3,d2 a3,b3 (13 Replies)
Discussion started by: dtdt
13 Replies

7. Shell Programming and Scripting

simple shell - how to get a parameter typed in a shell script

Hi, I am new to unix and using linux 7.2. I would like to create a script that would make it easyer for me to run my java programms. At the moment I have to type java myJavaprogram I am trying to write a script that will allow me to type something like this "myscript myJavaprogram" or maybe... (4 Replies)
Discussion started by: cmitulescu
4 Replies

8. Shell Programming and Scripting

Shell Parameter...

I am trying to get the value of the user id (uid), which is the shell parameter.Then, read the /etc/passwd and keep the lines where the uid is superior to the parameter and write this line in a new file. But I am not getting what I wanted. Perhaps there is a problem with the Syntax below :- ... (1 Reply)
Discussion started by: marconi
1 Replies

9. Shell Programming and Scripting

Help with a shell script to concatenate lists together

Below is a description of what im trying to achieve: Write a shell script to concatenate lists together, and output the resulting list. Do not include any argument that is a sub-list of the entire list. (The script will clean the list of any redundant items.) You must preserve the original order... (1 Reply)
Discussion started by: rfourn
1 Replies

10. Shell Programming and Scripting

How to cut, concatenate data in Shell Script

Hello All,, I'm very new to Unix and I'm more in SAP ABAP. I have a requirement for a shell script which will accept one parameter as Input file name(with directory) e.g : /sapdata/deubank/dbdirect/out/deu01deupe/in/deu01deupe20051207111320.pmt In the shell script I have to make two more... (2 Replies)
Discussion started by: vasan_srini
2 Replies
Login or Register to Ask a Question