Sponsored Content
Top Forums Shell Programming and Scripting Pass variables to a Unix script from a file Post 302385613 by sangharsh on Friday 8th of January 2010 04:26:01 PM
Old 01-08-2010
Pass variables to a Unix script from a file

Hi,

I am running a Java program from a unix script. I need to pass a variable to the Java code from a file. Here are teh details:

Code:
cat Parm <<this is my Parameter file>>
queuename=queue1



and my shell script is :

Code:
#!/bin/ksh
. ./Parm
/opt/java1.5/bin/java -classpath ./java.jar -queue $queueName

queue is a variable defined within the Java program. And queuename is what I need to get from the Parm file.

I hope I am making sense. Please let me know how to do this.

Thanks.

Last edited by radoulov; 01-08-2010 at 05:27 PM.. Reason: Please use code tags!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pass multiple variables to SQL script

I am trying to close of multiple users in an Oracle database. Each users has records in multiple tables what I need to do is use a script that call each SQL seperately passing either CLI arguments or gathered arguments from the users during run time. ## Accept variable(s) from the command line... (1 Reply)
Discussion started by: jagannatha
1 Replies

2. Shell Programming and Scripting

How to pass variables to 3rd party unix menu?

Hello, I was wondering if it is possible to pass data to a unix driven 3rd party menu. Changing the code is out of the question. I have a menu with various options and I would like a ksh to execute the menu and input the required fields. For example. Main menu 1. Company Name 2. blah... (3 Replies)
Discussion started by: ctcuser
3 Replies

3. Shell Programming and Scripting

reading from a file and pass as variables and ignore # in the file

file.txt contains ------------------ sat1 1300 #sat2 2400 sat3 sat4 500 sat5 I need to write a shell script that will output like the below #output sat1.ksh 1300 sat3.ksh sat4.ksh 500 sat5.ksh my try ------- (4 Replies)
Discussion started by: konark
4 Replies

4. Shell Programming and Scripting

how to pass variables from Asterisk to a C-script

Hi!I'm trying to write a script in C that Asterisk must call: I would to pass to the script a number digited by the user, make some elaboration with it and then pass the result to Asterisk. I don't understand the mechanism used by Asterisk to pass variable to/from a script: I know that variables... (1 Reply)
Discussion started by: lucio82
1 Replies

5. Shell Programming and Scripting

pass variables from one script to another

HI all I am calling a script "b" from script "a". In script "a", i connect to database and get month and year. I have to pass these same values to script b. How can i do that. How can i pass parameters from one script to another (3 Replies)
Discussion started by: vasuarjula
3 Replies

6. Shell Programming and Scripting

pass perl variables to shell script

I have a perl script that opens a text file containing numbers on each line: for example: 755993 755994 755995 755996 755997 755998 The perl script takes these numbers and store them as an array @raw_data, where I can access individual numbers by using $raw_data for the value 755993.... (2 Replies)
Discussion started by: xchen89x
2 Replies

7. Shell Programming and Scripting

how to pass variables to s3cmd in a script file

Hi All, How to pass the variable to s3cmd put command? I'm trying to use this command in a script as below: s3cmd put ${upload_path} s3://${upload_dest} where With the above command in script, the file is not getting uploaded. Please help!!! (4 Replies)
Discussion started by: mjavalkar
4 Replies

8. UNIX for Dummies Questions & Answers

Pass variables from a text file to a shell script

Hi, I have a text file as follows: a.txt ------ STEPS=3 STEP_DURATION=100 INTERVAL=60 I want to use these values in a shell script. How to go about this? (3 Replies)
Discussion started by: akarnya
3 Replies

9. Shell Programming and Scripting

How to pass the parameter in xml file in UNIX shell script?

Hi, I have an XML file like the following... <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ONDEMAND_JOB VERSION="5.1" LOCALE="en_US"> <IMPORT_JOBSET TC_CONNECTION_NAME="default" ENVIRONMENT="PRD" USERNAME="Administrator" PASSWORD="AdminPassword" CALENDAR="Main Monthly Calendar"... (2 Replies)
Discussion started by: Debalina Roy
2 Replies

10. Shell Programming and Scripting

How to pass the parameter in xml file in UNIX shell script?

Hi, I have an XML file like the following... <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ONDEMAND_JOB VERSION="5.1" LOCALE="en_US"> <IMPORT_JOBSET TC_CONNECTION_NAME="default" ENVIRONMENT="PRD" USERNAME="Administrator" PASSWORD="AdminPassword" CALENDAR="Main Monthly Calendar"... (3 Replies)
Discussion started by: Debalina Roy
3 Replies
JYTHON(1)						      General Commands Manual							 JYTHON(1)

NAME
jython - Python seamlessly integrated with Java SYNOPSIS
jython [ -i ] [ -S ] [ -v ] [ -Dproperty=value ... ] [ -Wargument ] [ -Ecodec ] [ -Qargument ] [ -jar jar | -c cmd | file | - ] [ script-args ] jython [ --help | --version ] DESCRIPTION
Jython is an implementation of the high-level, dynamic, object-oriented language Python seamlessly integrated with the Java platform. The predecessor to Jython, JPython, is certified as 100% Pure Java. Jython is complementary to Java and is especially suited for the following tasks: Embedded scripting: Java programmers can add the Jython libraries to their system to allow end users to write simple or complicated scripts that add functionality to the application. Interactive experimentation: Jython provides an interactive interpreter that can be used to interact with Java packages or with running Java applications. This allows programmers to experiment with and debug any Java system using Jython. Rapid application development: Python programs are typically 2-10X shorter than the equivalent Java program. This translates directly to increased programmer pro- ductivity. The seamless interaction between Python and Java allows developers to freely mix the two languages both during develop- ment and in shipping products. To make a jython script executable on your system you can add the following line to the top of the file: #!/usr/bin/env jython You will also need to add execute permissions to the script using chmod(1). Note that #!/usr/bin/jython will not work; you must use #!/usr/bin/env jython. This is because /usr/bin/jython is a script itself, not a compiled binary. OPTIONS
A summary of options is included below. -i Continue running Jython interactively after running the given script, and force prompts even if standard input doesn't appear to be a terminal. -S Don't imply import site on initialisation. -v Trace import statements on error output. -Dproperty=value Set the Jython property property to value; see jython.conf(5) for details of available properties. -Wargument Warning control. The full form of argument is action:message:category:module:line. Trailing empty fields may be omitted. Multiple -W options may be given. See documentation of the warnings module for details. -Ecodec Set the encoding used to read module source files from disk. -Qargument Division control. See PEP 239 for details. Valid arguments are old, new, warn and warnall. -jar jar The program to run is read from the file __run__.py in the specified jar archive. -c cmd The program to run is passed as the cmd string. This option terminates the options list. file The program to run is the script file. - The program to run is read from standard input (default behaviour). Interactive mode is used if running on a tty. This flag allows you to pipe a file into Jython and have it be treated correctly. script-args Command-line arguments to pass to the Jython script in sys.argv[1:]. --help Print a usage message and exit. --version Print the Jython version number and exit. ENVIRONMENT VARIABLES
JAVA (default: /usr/bin/java) The Java interpreter to use when running Jython. JAVA_OPTIONS (default: empty) Options to pass to the Java interpreter when running Jython. SEE ALSO
jythonc(1), jython.conf(5). If the Debian package jython-doc is installed, full documentation from the Jython authors will be available in /usr/share/doc/jython- doc/html/. AUTHOR
This manual page was prepared by Ben Burton <bab@debian.org> for the Debian GNU/Linux system (but may be used by others). It is based upon the official Jython documentation. July 7, 2001 JYTHON(1)
All times are GMT -4. The time now is 07:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy