Running a Java Programm with a (korn)shell-script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Running a Java Programm with a (korn)shell-script
# 1  
Old 01-07-2009
Running a Java Programm with a (korn)shell-script

hey everyone,

For my studies i had to write a javaprogram which reads 2 integers from the keyboard and then using the basic operations(addition, division etc) with them. so far no problem. but now i gotta make a shell-script which:

runs the program(compiled with javac)
#!bin/ksh
java Aufgabe1 > test1.log

so far so good. of course it works if i manually type the numbers. result and everything in the logfile are correct.
but i gotta make an inputfile(.txt) in which there are the 2 integers. so i gotta expand my script, reading the integers from the .txt file and running the program with those.

unhappily i got no clue, how to do that. anyone could help me here, plz?

regards simlmf
# 2  
Old 01-07-2009
If > sends output to a file, what do you think < will do?

BTW: No posting homework here, I'm afraid.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Korn Shell script in stopped state while running in background

Hi, I want to run a shell script in background . but its going to stopped state $ ksh cat_Duplicate_Records_Removal.ksh & 8975 $ + Stopped (tty output) ksh cat_Duplicate_Records_Removal.ksh & why is this happening? Also could anyone please tell me what is a stopped... (12 Replies)
Discussion started by: TomG
12 Replies

2. Shell Programming and Scripting

Running remote system shell script and c binary file from windows machine using java

Hi, I have an shell script program in a remote linux machine which will do some specific monitoring functionality. Also, have some C executables in that machine. From a windows machine, I want to run the shell script program (If possible using java). I tried with SSH for this. but, in... (1 Reply)
Discussion started by: ram.sj
1 Replies

3. Shell Programming and Scripting

running a script in korn shell

I'm learning bash and have discovered that the shell can only work with integers and not decimals. I'd like to run my scripts in korn to account for this, but just now, when I tried to run my script, I got an error message that said 'no such file or directory,' even though when I'm in the shell... (3 Replies)
Discussion started by: Straitsfan
3 Replies

4. Shell Programming and Scripting

Running a BATCH script from my korn script with multiparameters

I've this BATCH script to run from my korn script... The command is /usr/local/BATCH/runBatch.sh PARAM1 'PARAM2 -PARAM21 PARAM22' (runBatch takes parameter 1 = PARAM1 parameter 2 = 'PARAM2 -PARAM21 PARAM22' ) If i run this command from command line it just runs fine... ... (7 Replies)
Discussion started by: prash184u
7 Replies

5. Shell Programming and Scripting

Running shell script from java

Hello All, Hope all is well. I was trying to scratch my head here with simple problem of running Shell script in Java. I tried to google and look through forums but was unable to understand how to solve it. Here is my simple Java class, which resides in different directory then my shell... (2 Replies)
Discussion started by: samshaw
2 Replies

6. UNIX for Dummies Questions & Answers

running script with korn shell

How would i instruct the current shell to run the current script using the korn shell? (1 Reply)
Discussion started by: JamieMurry
1 Replies

7. Shell Programming and Scripting

Shell running setup in Korn ?

I am starting to code a few ideas of customization and tasks improvements on the office UNIX machine. My first script (see below) only contains ALIAS commands. But for some reason, when I execute it, the alias are not executed. I suspect it is because of the "#!/bin/ksh" not being recognized or... (4 Replies)
Discussion started by: Browser_ice
4 Replies

8. Shell Programming and Scripting

Running Shell Script from Java

Hi How can I call a .sh (shell script) from a java procedure? Is this possible at all? Please tell me. Thanks. Asty (3 Replies)
Discussion started by: Asty
3 Replies

9. Shell Programming and Scripting

Korn Shell script not running

I am sorry, this is really trivial, yet I am not able to understand what the problem is! I am using korn shell and running this script #!/bin/ksh keep=3 while ; do echo $keep keep=$(($keep-1)) done I am getting this error: `keep=$' unexpected I am not able to understand it because ... (1 Reply)
Discussion started by: Asty
1 Replies

10. Programming

Is there any possibility that invoking java function in c programm?

I think i am in trouble. I have to invoking a bunch of functions(such as encrypt, digital sign) from a java file(.jar), but I have no idea how to do that, Is there any possiblity? (6 Replies)
Discussion started by: virmin
6 Replies
Login or Register to Ask a Question