Sponsored Content
Top Forums Shell Programming and Scripting Launching a C program that needs input from a shell script Post 302369202 by momal on Friday 6th of November 2009 10:14:29 PM
Old 11-06-2009
Launching a C program that needs input from a shell script

hi there,
i need some help, i am trying to run a script to launch a C program and a Java program but before running both I want to get a user input and then invoke both programs with input received. In the programs the inputs are not command line arguments.

This is the code,
after the java bof and the ./bof.out how can I pass my $UserInput argument to both programs? And save the output from the 2 programs into two new arguments?

#!/bin/bash
#
#
clear
echo "Please enter a file name:"
read UserInput
echo "$UserInput"

java bof
./bof

Help is appreciated.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Executing program with Perl script but needs user input

Hello, I'm running a perl script to execute a program through my Unix command line. The program requires a user input but I want to automatically have perl input the string. Is there a way to do this? Thanks (1 Reply)
Discussion started by: leonard2352
1 Replies

2. Shell Programming and Scripting

input stored procedure to shell program

Hello, I have to call the stored procedure as argument from the unix shell program. Looks like unix doesnt like, can someone comment pls USERID=scott PASSWD=xxxxxx PLSQLCALL=$2 STDT=`sqlplus /nolog <<END >> $LOGFILE conn ${USERID}/${PASSWD}@${ORACLE_SID} whenever sqlerror exit failure... (9 Replies)
Discussion started by: tvanoop
9 Replies

3. Shell Programming and Scripting

Shell variable to c++ program as input

I have an Shell script which has few global variables eg : range=100; echo "$range" I want to use the same variable in my C++ program for example int main() { cout << range << "\n"; } i tried using this int main(int argc, char *argv) { cout << range << "\n"; } but... (5 Replies)
Discussion started by: shashi792
5 Replies

4. Shell Programming and Scripting

Help to write a script or program to automatic execute and link input file data

Output file template format <input_file_name>a</input_file_name> <total_length_size>b</total_length_size> <log_10_length_size>c</log_10_length_size> Input_file_1 (eg. sample.txt) SDFSDGDGSFGRTREREYWW Parameter: a is equal to the input file name b is equal to the total length of... (2 Replies)
Discussion started by: perl_beginner
2 Replies

5. Shell Programming and Scripting

Launching shell from another

hi, I have shell script ( say A.sh) that launches another shell script ( say B.sh) on the server. In shell script A.sh, if i call B.sh as . B.sh <-- it doesnt work, err file not found . ./B.sh <-- it doesnt work, err file not found ./B.sh <-- works why so? BTW the file exists at the... (4 Replies)
Discussion started by: sjc
4 Replies

6. UNIX for Dummies Questions & Answers

how to pass input from c program to shell script?

Hello.. I am developing a Graphical User Interface using GTK. As part of our project I need to take inputs from GTK entries and pass those inputs to shell script and use them in shell script. The problem which struck me is only limited number of inputs are getting passed to shell script. For now... (14 Replies)
Discussion started by: kalyanilinux
14 Replies

7. Shell Programming and Scripting

Shell script to input as if from command line to the java program

Hi, We are having a java server which can run on command line and once initiated, it will prompt options to enter from 0 to 5. The java program kickoff respective operation once number is entered between 0 to 5. However i want to always enter "1" and write another shell program wrapper to start... (4 Replies)
Discussion started by: surya5kn
4 Replies

8. Shell Programming and Scripting

Write a shell program with input

Hi, Here is my question: I want a shell script which I name as 'del', and can be used as del(string). when run del(string), it will delete several directories at different locations in my system,like: rm -fr /lustre/fs/scratch/user/$string rm -fr /home/user/$string rm -fr... (4 Replies)
Discussion started by: 1988PF
4 Replies

9. Shell Programming and Scripting

Seeing input that you redirect to a program on the shell

Suppose I have a program that I've written that accepts input, ie this C++ program: #include <iostream> using namespace std; int main() { cout << "Enter something:" << endl; int x; cin >> x; cout << "You entered data" << endl; } Suppose that I have a text file,... (5 Replies)
Discussion started by: Chris J
5 Replies

10. Shell Programming and Scripting

Launching mplayer from within Links2 using a shell script

I'm using the Links2 console web browser in graphical mode (the "-g" argument), and launching a shell script that invokes MPlayer from within it. MPlayer works fine. No problem there. The problem, is that I have no control over the MPlayer process. I would like to be able to exit MPlayer whenever... (16 Replies)
Discussion started by: ignatius
16 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 03:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy