Programming :: Java Coding To Use Call The Bash Script?

Oct 31, 2010

i am using front end as java and back end RHEL5.i am trying to calling a bash script with java. but i am facing problem.i am using following java coding to use call the bash script

import java.util.*;
import java.io.*;
public class b

[code]....

View 4 Replies


ADVERTISEMENT

Software :: Script That Call A Java Program That Call A System Command?

Nov 29, 2010

In practice I have a script that call a java program that call a linux system command. The script if I run it, from a shell functions well,so it is not a java problem. The problem come out when i put this script in a crontab schedulation. The result in this case is that java do not execute the system command. I think it depends on crontab

View 4 Replies View Related

Programming :: Write A Bash Script To Call From A Terminal?

May 24, 2010

I am trying to write a bash script to call from a terminal that will change the terminal title. I am using ubuntu 10.04. The script is meant to be used in the gnome-terminal.

Here is what I have:

Code: #! bin/bash
echo "New title: c"
read title
echo "33]0;$titl07c" -e

[Code]....

it doesn't work

I think the problem has to do with modifying PS1 inside the bash so i tried this:

Code: echo `export PS1="[e]1;u@h:wa]${debian_chroot:+($debian_chroot)}u@h:w$ "` and it still didn't work.

View 1 Replies View Related

Programming :: Java Output Into Bash Variable?

Feb 20, 2011

I have a bash script that calls a java class method. The method returns a string to the linux console when run independently. how can I assign the value from the java method to a variable in a bash script?running the script: java -cp /opt/my_dir/class.method [parameter]

output: my_string if added in a bash script:

read parameter
java -cp /opt/my_dir/class.method [parameter] | read the_output
echo $the_output

the above doesnt work, I also tried unsuccessfully:

the_output=java -cp /opt/my_dir/class.method [parameter]
the_output=`java -cp /opt/my_dir/class.method [parameter]`
java -cp /opt/my_dir/class.method [parameter] 2>&1

How can i get the output stored into the_output variable?

View 6 Replies View Related

Programming :: Running Bash Script Using Java?

Aug 18, 2010

how can i run a bash script script by using java in rhel5... then please reply....i have vary good project in my mind.....

View 2 Replies View Related

Programming :: Bash - Use The Call Command (displays The Current Month And The Next Month)?

Mar 8, 2011

how i can use the cal command so it displays the current month and the next month, i know you can use cal -3 9 2007 to show the previous current and next but i just want to display the current and next.

View 9 Replies View Related

Programming :: Invoke Java From Bash Terminal Via Shell Script Fails Under Mint Debian / Fix It?

Feb 16, 2011

I am running a Java application on the command line bash terminal under Mint Debian. I have JDK1.6.0_22 installed 64-bit, and the OS is 64-bit too. I have a few JAR files in the directory and a few native LWJGL libraries. When I run the application using the command line, all works fine.
Lets assume my directory where the files are is called /home/riz/MyGame. I change to that directory and this is the command I use code...

View 3 Replies View Related

General :: Command To Check The Java Version: Java -versionand Got :bash :java: Command Not Found?

Jul 26, 2010

I've just installed java (jre-6u21-linux-i586.bin) on Red Hat 4.4 AS and issued this command to check the java version: java -versionand got :bash :java: command not found

View 4 Replies View Related

Programming :: Unzip The *.bz2 File Using Php Coding?

Nov 29, 2010

Below is my code to create *.bz2 file.

<?php
//Moving file to temporary directory for compression
move_uploaded_file($_FILES["file"]["tmp_name"],"c:/" . $_FILES["file"]["name"]);
$url="c:/".$_FILES["file"]["name"];
//File compression

[Code]....

Anyone know, how to unzip the file ? I've tried the above code to unzip it but it creates only 1kb of file for any files.

View 3 Replies View Related

Applications :: Call Java From The Php?

Dec 2, 2010

I would like to call my java program from php. How is it possible I know of zend bridge but when I read it say it will take our the existing php which I am not sure what other side effect I will have to face.

View 3 Replies View Related

Programming :: Coding A Sniffer Program For Windows ?

Feb 11, 2010

What sort of libraries can i use for coding of sniffer program for windows and linux? The sniffer that i want to code is for capturing the list of connected clients to AP wirelessly. I do know that the wireless NIC needs to be in 'monitor' mode in both windows and linux.

View 4 Replies View Related

Programming :: Perfect Example Of Improvements In C/C++ Source Coding?

Sep 11, 2010

[URL]...In this bug, you'll see that I actually fixed my own problems that surfaced when building GNOME Shell from source.

View 1 Replies View Related

Programming :: Coding Dilemma: Build Application With PHP Framework?

May 7, 2009

I've been a PHP developer for about 6 years now - the last two years I have been pretty inactive though. Just recently though, I have been reading resources on all the different programming patterns (Factory, Singleton, Registry, Observer, MVC, etc) to try and get my head around good programming techniques. For myself though I find that I can only truly understand how these methods work when I am forced to do them myself.I have a large project I am doing at my workplace (me only) that involves building a very complex PHP application.

I would like to know your professional opinion; should I spend the extra time to program this PHP application myself and really, properly learn all these different programming patterns? Or, should I just build on top of a PHP framework like the Zend Framework for speed's sake (and flexibility/features)?

I have found understanding exactly how the Zend Framework works hard, just because I haven't been exposed to using these programming patterns myself. I hate that - I want to fully understand exactly what is happening in my application and know exactly how each part relates to others.

View 2 Replies View Related

Programming :: C Coding Hacking / Ssh Dynamic Local Port Forwarding Implementation?

Feb 3, 2010

From this thread I've decided to try add a feature of removing local port forwardings in ssh.Here are some very ugly and not-yet working hacks what I made so far:

* Patch for channels.c
* Patch for channels.h
* Patch for clientloop.c

I was clearly expecting this to work without any troubles-everything seem to be logically correct, but I made a programming mistake somewhere: don't know where, maybe you will point me to this?Many sites say there is a WAY AROUND with -D param(starting socks proxy as a tunnel-generator), added since 5.2, but I don't need that way around. I need a way through. I use exact ports for exact services and if I want to change it runtime I'd like to have ability to do so.If you have other ideas or points instead of coding this, please share them here & here(original question).

View 2 Replies View Related

Ubuntu :: Javascript To Call Bash Command

Sep 21, 2010

First, i have no experience with javascript. I came across an interesting site and I'm curious if I could make a private webpage to call some shell commands or just open a terminal.Yes, i know this could potentially be malicious and possibly illegal. Again it's for my own private usage.

View 1 Replies View Related

General :: Call Another Bash Script To Run On A Subfolder?

Sep 29, 2010

I want my bash script to run scripts located on a different folder. If it is also located on the same folder with my script, it will go like this:

on my $HOME folder: (this_script.sh, backup.sh, restore.sh, purge.sh)
#!/bin/bash
./backup.sh
./restore.sh
./purge.sh

But what if, on my $HOME folder: (this_script.sh)

$HOME/scripts folder: ( backup.sh,restore.sh, purge.sh )

Below doesn't work...

#!/bin/bash
./$HOME/scripts/backup.sh

View 5 Replies View Related

General :: Cd Dirname - Use The Output Of A Nested Bash Builtin Call

May 2, 2011

I'm trying to remember how to use the output of a nested Bash builtin call. So `which prog` gives me the path to the program, i'm interested in. Then I would like to get the directory path leading to that program and plug it into 'cd', so i end up in the directory containing the program.

View 5 Replies View Related

General :: System Call (not Bash Command) To Format Partition?

Feb 18, 2011

I'm working on Linux OS (Suse/redhat) and trying to format a linux partition from a c program. Is there a way to do this without using : 'system ("mkfs.ext4 /dev/sdxy")'

View 4 Replies View Related

Software :: Call Website With Bash Script From Private Server?

Jun 30, 2011

Me and my friends have a website about games and stuff. The web hotel we use clears the app-pool when it has been inactive for 15 minutes. We don't have that many users yet so this is a problem because it takes ages to load if it has been inactive. I came up with the brilliant idea of calling the website with a script from my private server at home every 5 minutes or so. That way it would never go down.

I used some lines from another of my scripts:
wget -q -O - http://homepage.se/ > /path/to/a/file.txt
cat /dev/null > /path/to/a/file.txt
and put it in crontab.

The script runs and all and I think it's better now but we can't know for sure if it is the scripts doing. Sometimes it's just as slow as ever and I start to think the script doesn't do anything. I've tried adding more wget-lines to fetch some different pages from the site and now running it every 3rd minute. No difference. Does anyone know another way to call a website in a way that would solve my problems? Am I using the wrong options with wget maybe? I've tried lynx (and piping to file) but it didn't work.

View 7 Replies View Related

Programming :: Parse Error "in C:wampwww$_GET" In Php Coding

Jan 23, 2011

there is some error... Parse error: parse error in C:wampwww$_GET ewget.php on line 11

<?php
function create_hashing(){
$url = 'url';
// $urls = $_GET["url"];
$urls=$_GET["$url"];
if (isset($_GET[$urls]))
//Start MD5 Hash Generator\
$pass2=$_GET["$urls"];
[Code]...

View 1 Replies View Related

Programming :: Add Switch To Every Gcc/g++ Call?

Feb 23, 2009

I was wondering if there was a way to add a switch to a gcc/g++ call everytime. I have a few libraries that I need to compile for different processors. Each has a makefile which calls gcc to compile. Here is the best option I could come up with so far:Include a Makefile and define CC as gcc -mcpu=xxx.

View 4 Replies View Related

Programming :: Call C Executable Inside C

Jan 8, 2010

i have only basic knowledge of C so guys plz help me...is C language support call the C executable inside the C ?example contect mainA.c have a many function define in the struct,when i compile mainA and make a executable the name is ( A ),can i use executable C inside the C <my C program call the executable ( A ) > .

View 9 Replies View Related

Programming :: Execvp System Call?

Apr 3, 2011

in below program why was new_args[0], rather than the reference the_cmd, passed to the execvp system call?

Code:
/*
A _very_ limited shell program

[code]....

View 2 Replies View Related

Programming :: Call The Executable File From The GUI?

Jun 1, 2010

I have created a executable file using c and I have also created a GUI using GTK+. Now how can I call the executable file from the GUI with arguments passing to the executable file.

View 4 Replies View Related

Programming :: How To Call Fortran Subroutine From IDL

Sep 29, 2010

There are examples everywhere about calling f77 subroutine from IDL, but I have not found any material about IDL calling fortran written in f90 way(free style). I tried the following example, but write the subroutines in free style. When I run the makefile, it gives an error 'undefined reference to main_'.

Code:

SUBROUTINE SUM_ARRAY(argc, argv) !Called by IDL
INTEGER*4 argc, argv(*) !Argc and Argv are integers
j = LOC(argc) !Obtains the number of arguments (argc)

[code]....

View 1 Replies View Related

Ubuntu :: BASH Script To Get PID Of Java File?

Jun 18, 2011

I have a simple bash script called run.sh:

Code:
java -jar /testing/run.java How do I get the Process ID and save it in a file called "PID"

View 1 Replies View Related

Programming :: Bash: Printing The Line Number In Bash Script?

Feb 4, 2011

I would like to know how do I print the line # in a script. My requirement is, I have a script which is about ~5000 lines long. If there are any errors happen I just exit. And I would like to add the line # of the script where the error happened.

View 3 Replies View Related

Programming :: Bash Ctrl+c Tarp And Bash Read With Timeout?

Jan 24, 2010

simple bash code:

Code:
#!/bin/bash
trap "echo 'you got me'" SIGINT SIGTERM # to trap ctrl+c
echo "Press ctrl+c during 5 sec loop"
for ((i=0;i<5;i++)); do

[Code]...

How come code behaves normally and stops when ctrl+c signal is caught and resumes, but after I use at least one timeout read in the code it looks like, if signal is caught again it doesn't pause the execution but skips the loop. If you remove -t (timeout) option from the read, both loops look the same!

View 10 Replies View Related

Programming :: SSL_write Returns SSL_ERROR_SYSCALL, EOF On Second Call

Oct 8, 2010

I am facing issue in my OPENSSL code. I have written openssl client. It sends request to the host and receives response for that request.

My problem is, it connects, sends request successfully to host at first time only in sencond attempt it fails on SSL_write(). where SSL_get_error() returns SSL_ERROR_SYSCALL error.

In that ERR_get_error() returns 0. man page shows "If ret == 0, an EOF was observed that violates the protocol".

Code Snippet.
w=SSL_write(SSLRequestData.ssl,c2s,c2sl);
switch(SSL_get_error(SSLRequestData.ssl,w))
{
case SSL_ERROR_NONE:
if(c2sl!=w)

[Code]....

View 3 Replies View Related

Programming :: Clarification In The Select System Call?

Dec 8, 2010

I have a process that forks, where the childs puts some data of random size and exits while the parent should get the data and does some manipulation.. here I have used a pipe for child to write the data and parent to read the data.. Child simply dumps the data, and the data is of any size even child and parent doesnt know.
I have used select in the parent to see whether there is any data coming on the reading end of the pipe.. if there is a data.. I copy into a buffer.. Im reading the data continusly when the child exits after closing the writing end of pipe. Parent gets blocked on the read part But my question is how parent know the other of pipe is closed when using the select call. In otherwords.. while using select in readfds, how would i know the other end has closed the pipe..

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved