Sponsored Content
Top Forums Shell Programming and Scripting Problem while concatenating variables in shell script Post 302499202 by Adhil on Wednesday 23rd of February 2011 03:56:57 PM
Old 02-23-2011
Problem while concatenating variables in shell script

Hi folks,

I am facing problem when I concat variables with the string.

Value for 'JDBC_CLASSES' variable looks malformed (/classes12.zip2.0KAGES)

But, my expected result for 'JDBC_CLASSES' is
/opt/API-R111/PACKAGES/jdbc/ORACLE9.2.0/classes12.zip

Am I missing anything here?

My Script :
-------------
Code:
#!/bin/sh
echo "== SET ENVIRONMENT VARIABLES =="
export PACK_HOME=/opt/API-R111/PACKAGES
export JDBC_VER=ORACLE9.2.0
export JDBC_CLASSES=${PACK_HOME}/"jdbc/"${JDBC_VER}/"classes12.zip"
echo $PACK_HOME
echo $JDBC_CLASSES

jmc: added code tags
Output:
--------
[weblogic@localhost admin]$ sh setenv.sh
== SET ENVIRONMENT VARIABLES ==
/opt/API-R111/PACKAGES
/classes12.zip2.0KAGES

Any help on this is highly appreciable.

Regards,
Adhil

Last edited by jim mcnamara; 02-23-2011 at 05:19 PM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Concatenating Variables

FILE_DATE=$(date +"%Y%m%d_%H%M")_ FILE_PREFIX=${FILE_DATE} echo $FILE_PREFIX JS_LOG_DIR="E:\DecisionStream Jobs\Invoice Balance Fact Jobs" echo $JS_LOG_DIR --This is where the problem surfaces. The last line of this script does a rsh to an NT machine and one of the parameters is the... (2 Replies)
Discussion started by: photh
2 Replies

2. Shell Programming and Scripting

Concatenating Different # of Variables

Hi, I'm quite new at unix and was wondering if anyone could help me with this. I have 2 arrays: eg. STAT=online, STAT=offline, STAT=online WWN=xxxx1, WWN=xxxx2, WWN=xxxx3 I got these information from a script using fcinfo hba-port that runs through a loop. Now, I want to store... (2 Replies)
Discussion started by: jake_won
2 Replies

3. Shell Programming and Scripting

problem accessing Multiple Variables from C Program to a Shell script

program name--test #!/bin/bash output1=`/home/user/a.c` output2=`/home/user/a.c` k=`$output1 + 1` m=`$output2 + 1` echo $k echo $m --------------------------------------------------------------------------- prgram name--a.c #include<stdio.h> int main() (1 Reply)
Discussion started by: sameworld1980
1 Replies

4. Red Hat

Concatenating variables

Hi all, I'm trying to do a very simple script, as you can see as follow: #!/bin/bash #Valorizzazione Token presenti nel file di properties var_path_weblogic="`cat weblogic.properties | grep "dir_wl" | /usr/xpg4/bin/awk '{print $3}'`" var_ip_address="`cat... (5 Replies)
Discussion started by: idro
5 Replies

5. Shell Programming and Scripting

bash -- concatenating values from variables

Hi This is a simple one but I got a lost in translation when doing. What I want to do, given both variables in the example below, to get one value at the time from both variables, for example: 1:a 2:b etc... I need to get this in bash scripting code: varas="1 2 3 4" varbs="a b c d"... (4 Replies)
Discussion started by: ranmanh
4 Replies

6. Shell Programming and Scripting

Concatenating fixed length lines in shell script

I have a peculiar file with record format like given below. Each line is wrapped to next lines after certain number of characters. I want to concatenate all wrapped lines into 1. Input:(wrapped after 10 columns) This is li ne1 This is li ne2 and this line is too lo ng Shortline ... (8 Replies)
Discussion started by: kmanyam
8 Replies

7. Shell Programming and Scripting

Problem in Global variables in shell script

hi, i have a shell script which calls another shell which in turn calls another shell script. Main_shell_script.sh echo "In Main_shell_script.sh" FILENAME="original.txt" # LINE 1 DST_FILENAME=$FILENAME # LINE 2 echo "FILENAME = {$FILENAME}" echo "DST_FILENAME =... (3 Replies)
Discussion started by: Little
3 Replies

8. UNIX for Dummies Questions & Answers

How to write Config shell script to pass variables in master shell script?

Dear Unix gurus, We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies

9. Shell Programming and Scripting

How to write config shell script to pass variables in master shell script?

Dear Unix gurus, We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies

10. UNIX for Beginners Questions & Answers

Concatenating two mutiline variables in a bash

Hi All, I am having a situation where am capturing results in two variables from an xml file. However, I am looking to print those two variables with pipe in between them and these variable are multi-line. This is how my 1st variable looks like: 20181225010 20190224010 20190224010... (8 Replies)
Discussion started by: svks1985
8 Replies
asadmin-create-jdbc-resource(1AS)				   User Commands				 asadmin-create-jdbc-resource(1AS)

NAME
asadmin-create-jdbc-resource, create-jdbc-resource - registers the JDBC resource SYNOPSIS
create-jdbc-resource --user admin_user [--password admin_password] [--host localhost] [--port 4848] [--secure|-s] [--passwordfile filename] [--terse=false] [--echo=false] [--interactive=true] --connectionpoolid ID [--enabled=true] [--description text] jndi_name Registers the JDBC resource. This command is supported in remote mode only. OPTIONS
--user authorized domain application server administrative username. --password password to administer the domain application server. --host machine name where the domain application server is running. --port port number of the domain application server listening for administration requests. --secure if true, uses SSL/TLS to communicate with the domain application server. --passwordfile file containing the domain application server password. --terse indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well- formatted data for consumption by a script. --echo setting to true will echo the command line statement on the standard output. --interactive prompts you for the required options that are not already specified. --connectionpoolid name of the JDBC connection pool. If two or more JDBC resource elements point to the same connection pool element, they will use the same pool connections at runtime. --enabled determines whether the resource is enabled at runtime. --description text description of the JDBC resource. OPERANDS
jndi_name JNDI name for resource to be created. Example 1: Using the create-jdbc-resource command asadmin> create-jdbc-resource --user admin1 --password adminadmin1 --host pigeon --port 5001 --connectionpoolid XA_connection_pool --description "creating a sample jdbc resource" sample_jdbc_resource Command create-jdbc-resource executed successfully Where: sample_jdbc_resource is the resource that is created. EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-delete-jdbc-resource(1AS), asadmin-list-jdbc-resources(1AS) J2EE 1.4 SDK March 2004 asadmin-create-jdbc-resource(1AS)
All times are GMT -4. The time now is 01:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy