03-30-2009
Passing Integers to shell script from java
i have to pass an integer value to shell script which will mail the values to users.
I am able to pass string values like this.
try {
String[] strCmdToRun1 = new String[] { "sh", "mail.sh","hello"};
Process p1 = rtime.exec(strCmdToRun1);
BufferedReader output = new BufferedReader(new InputStreamReader(
p1.getInputStream()));
}
Please let me know how i can pass integers to a shell script from java
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
am trying to write a script that test that the load average which is taken from the uptime command's output to make sure it doesn't pass a certain limit. each time I execute the script, it complains about interger errors.
if (2 Replies)
Discussion started by: TRUEST
2 Replies
2. Shell Programming and Scripting
I'm currently working on my second ever ksh script!
So I apologize if this is a stupid question - I've searched the forum and on google and haven't seen anything :confused:
I'm running my script with an input at startup
that variable determines a couple of other values(int) that I store into... (1 Reply)
Discussion started by: Cailet
1 Replies
3. UNIX for Dummies Questions & Answers
Hi:
I have a script called runjava:
The content ---
search=$1
dpi=$2
prefix=$3
input=$4
output=$5
java -Djava.library.path=./lib/path/Lib -classpath .:lib/path/Lib/mylib.jar myclass $search $dpi $prefix $input $output
How does myclass parse arguments ---
String searchTerm =... (3 Replies)
Discussion started by: kenpeter
3 Replies
4. Shell Programming and Scripting
please help
shell script that adds two intergers and display answer on screen (1 Reply)
Discussion started by: wanyac2
1 Replies
5. Shell Programming and Scripting
Hi All,
I want to pass array of argument from Java to a shell script.I can use process builder api and its exec() method to call the script,but the question is how to receive the parameter in the script.
Thanks in advance
---------- Post updated at 10:00 PM ---------- Previous update was... (1 Reply)
Discussion started by: Abhijeet_Atti
1 Replies
6. Programming
Hello
Please i want to pass parameter (the string s) to the shell script:
Quote:
String s="Hello";
Process process = Runtime.getRuntime().exec("sh script1.sh");
How can i do please?
Thank you (0 Replies)
Discussion started by: chercheur857
0 Replies
7. Shell Programming and Scripting
Hi,
I am working in bash in Mac OSX, I have following 'input.txt' file:
<INFO> HypoTestTool: >>> Done running HypoTestInverter on the workspace combined
<INFO> HypoTestTool: The computed upper limit is: 11 +/- 1.02651
<INFO> HypoTestTool: expected limit (median) 11
<INFO> HypoTestTool: ... (13 Replies)
Discussion started by: Asif Siddique
13 Replies
8. Shell Programming and Scripting
I need to run a local shell script on a remote machine. I am able to achieve that by executing the command
> ssh -qtt user@host < test.sh
However, when I try to pass arguments to test.sh it fails.
Any pointers would be appreciated. (7 Replies)
Discussion started by: Sree10
7 Replies
9. Shell Programming and Scripting
Hi,
I have a shell script (script.sh) in which we are calling java code which asks for
Username:
Password:
for authentication purpose
currently we are passing the credential manually and run the script.
but I am trying
echo -e "user_id\npassword" | script.sh
but its not... (1 Reply)
Discussion started by: rakeshtomar82
1 Replies
10. Programming
Hello Good Day / Guten Tag....
I have to login the server and the user profile contains some scripts which need the inputs to be taken from the keyboard.
So I use the method to conn.authenticateWithKeyboardInteractive(username, new InteractiveCallback() {
public String... (1 Reply)
Discussion started by: Sanalkumaran
1 Replies
SHAR(1) BSD General Commands Manual SHAR(1)
NAME
shar -- create a shell archive of files
SYNOPSIS
shar file ...
DESCRIPTION
shar writes an sh(1) shell script to the standard output which will recreate the file hierarchy specified by the command line operands.
Directories will be recreated and must be specified before the files they contain (the find(1) utility does this correctly).
shar is normally used for distributing files by ftp(1) or mail(1).
SEE ALSO
compress(1), mail(1), tar(1), uuencode(1)
BUGS
shar makes no provisions for special types of files or files containing magic characters.
EXAMPLES
To create a shell archive of the program ls(1) and mail it to Rick:
cd ls
shar `find . -print` | mail -s "ls source" rick
To recreate the program directory:
mkdir ls
cd ls
...
<delete header lines and examine mailed archive>
...
sh archive
HISTORY
The shar command appears in 4.4BSD.
SECURITY CONSIDERATIONS
It is easy to insert trojan horses into shar files. It is strongly recommended that all shell archive files be examined before running them
through sh(1). Archives produced using this implementation of shar may be easily examined with the command:
egrep -v '^[X#]' shar.file
4.4BSD June 6, 1993 4.4BSD