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


ADVERTISEMENT

General :: Invoke A Function In Bash Shell Script?

Apr 24, 2010

I just wonder the distinction calling the function between $(one_function) and one_function in bash shell script.

When I set the variable PS1 in ~/.bashrc, I can't invoke the function by one_func
ex:

export PS1="
[e[31m] $(one_func) # it works
export PS1="
[e[31m] one_func # it doesn't work

View 3 Replies View Related

Programming :: Perl About System Command / Fails If The Standard Shell Is Dash And Not Bash?

Jun 30, 2011

I am trying to fix a perl script, and I really suck at perl. But I think this problem will be easy for people who know it.

The problem is, I have an old setup script someone wrote many years ago. It fails if the standard shell is dash and not bash. The only way I've gotten it to work is to point /bin/sh to bash. I looked thru the script and it uses "system" many places, and I think that's the problem.

I searched for it and found this link:url

My plan is to include this function:

Code:
sub system_bash {
my @args = ( "bash", "-c", shift );
system(@args);
}
Then I could simply change all calls to system into system_bash and it should work?

The parameter to the system calls is usually some variable. What if the parameter is a list already? Do I need to test for it somehow, and if it's a list, prepend "bash" and "-c" to the list? How do I do that?

In the script there are lots of places like this:

my $error = system($cmd);
if ($error) {
die/warn "some error message";
}

Shouldn't there be a return in the system_bash function?

View 8 Replies View Related

Programming :: Can't Invoke A Command From Within Shell Script / Sort It?

May 17, 2010

When I try to invoke 'source' command from within a shell script, namely, myscript.sh, I get the following error message code...

View 1 Replies View Related

Programming :: Invoke The Calculator In Bash Script?

May 16, 2010

My main problem right now is doing floating point arithmetic within a bash script, with variables.Right now I have a folder called "myExamples" with a script called "run_example" that runs with no issues.I plan to(1) create many folders inside [myExamples], that are named [example10] [example11]...each containing an identical copy of (run_example),(2) modify Line 172 of each copy of (run_example)...in one copy, it would be 3.00, the next copy would have 3.05, etc. (This part doesn't work!)How can I use the available calculator bc code to do floating point operationsMy code is below -

#!/bin/sh
# run from directory where this script is
cd `echo $0 | sed 's/(.*)/.*/1/'` # extract pathname

[code]....

View 1 Replies View Related

Programming :: Invoke The Calculator "bc" In Bash Script For Floating Point Arithmetic?

May 15, 2010

My main problem right now is doing floating point arithmetic within a bash script, with variables.Right now I have a folder called "myExamples" with a script called "run_example" that runs with no issues.I plan to(1) create many folders inside [myExamples], that are named [example10] [example11]...each containing an identical copy of (run_example),(2) modify Line 172 of each copy of (run_example)...in one copy, it would be 3.00, the next copy would have 3.05, etc. (This part doesn't work!)How can use the available calculator bc code to do floating point operations?My code is below -

#!/bin/sh
# run from directory where this script is
cd `echo $0 | sed 's/(.*)/.*/1/'` # extract pathname

[code]...

View 2 Replies View Related

Programming :: Bash-shell-like Less Functionality In The Python Shell?

Jun 25, 2010

Is there some type of functional way to read things in the Python shell interpreter similar to less or more in the bash (and other) command line shells?

Example:

Code:

>>> import subprocess
>>> help(subprocess)
...
[pages of stuff to read]
...

I'm hoping so as I hate scrolling and love how less works with simple keystrokes for page-up/page-down/searching etc.

View 4 Replies View Related

OpenSUSE :: Gnome Terminal: How To Get The Bash Shell

Mar 17, 2010

i've finally got a NIX environment...yipee! Installed opensuse 11.2 in a dual boot with windoze with no problem whatsoever. unfortunately, my NIX skills are sadly dated or maybe things have changed or both. in any case, i have a rather trivial problem that i have not been able to figure out.

i go to gnome terminal to get to the bash shell, no problem except when i do things like cat, less and so on. the commands do what they do then when done the last line output is "some text" and "(END)" - at the completion of the command it does not return to the bash shell. i've tried ctrl-everything, enter, escape, actually all keystrokes i can think of to get back to the bash shell...no luck. man and docs have not been helpful or i simply missed the answer (i'm a little saturated at this point).the only thing i've been able to do to solve my dilema is close the terminal an start a new instance, not elegant but works.

View 8 Replies View Related

Programming :: Running Shell Script From A Java Prg

Feb 20, 2011

I am facing problem of trying to access parameters to be given to shell script within a java prg.

I have following code to run the process within java but the parameter is not recognized within $ or without it also.

Code:

View 13 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

Debian :: Change Dragora Bash Terminal To Default Jessie Terminal

Feb 29, 2016

I mainly use debian jessie , recently i have installed daragora as my second os to get a feel of gnu/linux . the problem is that dragora uses bash , and it's commands are different from debian jessie terminal is there a way that i can use the same commands here in dragora?

View 4 Replies View Related

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 View Related

Ubuntu :: Invoke The Terminal In LINUX When A Process Becomes Unresponsive?

Jan 6, 2010

If a process becomes unresponsive in WINDOWS then we press "alt+ctrl+del" to invoke the task manager & then terminate the process.Is there any similar way to invoke the Linux Terminal so that we can end a process by the 'kill' command when it becomes unresponsive?

View 2 Replies View Related

Software :: IDE For Bash / Shell Programming

Mar 24, 2010

I just wanna ask if there's a ide for bash/shell programming?

View 2 Replies View Related

Programming :: Three Scripts - Using Bash As Shell

Feb 9, 2010

I am looking for three scripts (using bash as shell): to print out a list only with directories (no files) that they are found in running directory (no in subdirectories) to print out a list only with files (no directories) that they are bigger than 10Kb and are found in running directory (and in subdirectories) to print in the screen the lines of file with accidental order.

View 13 Replies View Related

Programming :: Difference Between Shell And Bash Scripts?

Sep 25, 2010

Whats the difference, and when do you use which?

View 2 Replies View Related

Programming :: Bash Shell Script Arithmetic??

Nov 10, 2010

I have four files that contain numbers that I grep for in a variable#!/bin/bashcat FILENAME`date +%y%m%d*.tot` | grep Grand | awk '{print $4}'

#output is
12
67

[code]...

View 6 Replies View Related

Programming :: Difference Between Formats In BASH Shell

Apr 30, 2009

I searched around but I can't get a good handle on the difference between the following formats in BASH shell.

$VAR
$(VAR)
$((VAR))
$($VAR)
$(($VAR))

Can someone explain it, or point to a clear, concise document explaining it?

View 3 Replies View Related

Programming :: Combining Commands And Var's In Bash Shell Script?

Jan 5, 2011

I have a command which on the command line needs to look like this

rlam -if3 '!pvalue -H image1.jpg' > image2.jpg

Nevermind what rlam or pvalue do ... they are part of a program package I am using. The above command works on the command line, and also when written verbatim in a bash shell script.

My problem is: in the script I wish to replace image1.jpg with the content of a variable, e.g.

IM1=image1.jpg

How to I get the script to insert the value of $IM into the command when the pvalue part of it needs to be quoted?

View 1 Replies View Related

Programming :: BASH Shell Differences: Login Or Interactive

Feb 18, 2011

Intuitively I think that the Login Shell and the Interactive Shell are the same applications but have access to different environmental variables.It this true? Why is there more than one type of shell anyways? You can change users with the interactive shell, why not log on with it to?

View 10 Replies View Related

Programming :: Loops In Bash Shell Or Variable Math?

Oct 28, 2010

I am trying to map the coordinates of a grid.

Code:

R=7 # number of rows (lines)
C=6 # number of columns
X=200 # initial horizontal location
Y=100 # initial vertical location

[code]....

View 4 Replies View Related

Programming :: Bash If *sometimes* Fails To Detect Embedded Newline

May 21, 2011

Using xsel I pass a selection into a variable. I then check that the variable includes an embedded newline to be sure that the selection returned by xsel is complete. If the selection content preceding the newline is just a single word, the check fails to detect the newline, thus

Code:

g fnm=`xsel`
g cat <<< "$fnm"
Whatis
apropos sear

[code]....

View 14 Replies View Related

Fedora :: Invoke 'skype' Using Command In Terminal Window - Error Message Set Out On Attachment

Jan 13, 2011

I am able to invoke 'skype' using the following command in a Terminal window. < export XLIB_SKIP_ARGB_VISUALS=1 && LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so && skype & >. I want to be able to enter it through the Gnome Application interface. I right click on the skype icon and went to properties and added the above code. When I click the icon I get the following error message set out on the attachment? properly enter the commands within the application Command: line?

View 2 Replies View Related

Programming :: Kill Follow-on Code If Source Fails In Bash?

Dec 20, 2009

I have a Bash script that runs other bash scripts. If the parent code fails, is there any way for me to also kill the child code?That kills any multiple instances of a script if I run it more than once. Is there any way I can just modify this into something that prevents the child code from running/continuing from running if the parent stops from an error?

View 3 Replies View Related

Programming :: Creating Array From Command Output (Bash Shell Script)

Jan 26, 2011

I have a command that outputs n lines of text, and I want to place each line into an array element, but I can't seem to get the syntax correct

So my command is this:
cat $configfile | sed -n '/cluster:'$clustername'/,/cluster/ p' | awk /host/

Which produces many lines depending on the value of $clustername. I'd like to get each line as elements of an array.

View 5 Replies View Related

Programming :: Writing Shell Snip To Import CSV Data Into Bash Array

Jan 5, 2011

I have been trying to write a simple snip of bash shell code to import from 1 to 100 records into a Bash array.

I have a CSV file that is structured like:
record1,item1,item2,item3,item4
record2,item1,item2,item3,item4
record3,item1,item2,item3,item4
record4,item1,item2,item3,item4

And would like to get this data into corresponding arrays as such:
$record1[item1-4]
$record2[item1-4]
$record3[item1-4]
$record4[item1-4]

View 9 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 :: Run Small Shell Script - Bash - Syntax Error Near Unexpected Token `('

Jul 9, 2010

I was trying to run small shell script, but could not run. I got the error like in subject.

This is exact way i was trying to do.

View 6 Replies View Related

Programming :: Global Bash Shell Functions - A.sh: Line 2: Echotm: Command Not Found

Sep 13, 2010

I wonder if there is anyway to make a user-defined bash shell function global, meaning the function can be use in any bash shell scripts, interactively or not. This is what I attempted:

Code:

$ tail -n 3 /etc/bashrc
echotm () {
echo "[`date`] $@"
}

[code]....

View 11 Replies View Related







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