LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-30-2011, 10:52 AM   #1
ITPhoenix
Member
 
Registered: Mar 2011
Location: Northeast USA
Distribution: Debian Squeeze
Posts: 47

Rep: Reputation: 1
Java with bash script in command path


I am working with the Sphinx4 AVR/IVR recognizer written entirely in Java. In a command and control demo, called "Dialog Demo" we have to create our own command scripts so the program actually does something. Here is their commentary:
Quote:
When the program runs, you will be presented with a menu of commands that can be spoken. Here is a sample run. The spoken commands are highlighed in green. Note that this is just a demonstration of the speech technology. This demo will not actually perform the command. Thus, when you say "play games / play adventure " no game will actually played, similarly, when you say "make a phone call / call paul" no phone call will be made.

Note - when browsing newspapers from the 'news' menu, this demo will actually attempt to open the news page in your web browser by executing the command 'browse web-page-url'. If you want to enable this feature place a browse script in your command path. The script I use with the firefox browser is this:
Code:
#!/bin/sh

export FF_HOME="/usr/share/firefox

url="$1"
if [ "x$url" = "x" ]; then
  url="about:blank"
  fi

  if $FF_HOME/mozilla-xremote-client openURL\("$url"\); then
    exit 0
    fi
    exec $FF_HOME/firefox "$url"
If you surmised I am a newb to programming you are correct. I know how to write a bash script, but I have no idea how this implementation works, where this script should go, what "command path" actually means, etc. I see that Java calls for "system" but I have no handle on that. I am still at "Hello World" with Java.

And how does one find the commands to start and manipulate various programs and utilities--easily? I come across them in tutorials or Google to find them, but I have not seen any systematic way of locating them.

I am just asking for pointers since I really need to learn all this myself.

Any help is much appreciated.
 
Old 09-30-2011, 11:25 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,464
Blog Entries: 54

Rep: Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899
Code:
function help() { echo "Bash scripting guides:
http://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html 
http://www.tldp.org/LDP/Bash-Beginners-Guide/html/index.html 
http://www.gnu.org/software/bash/manual/html_node/index.html
http://www.grymoire.com/Unix/Sh.html
http://www.tldp.org/LDP/abs/html/ 
http://wooledge.org/mywiki/BashFAQ?action=show&redirect=BashFaq 
http://wooledge.org/mywiki/BashPitfalls"; }
 
  


Reply

Tags
bash scripting, commands, control, java


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Command path is in PATH but bash does not find the command. stf92 Linux - Newbie 17 03-23-2012 04:19 AM
[SOLVED] bash: how to know in the script the path to itself? netimen Linux - General 6 10-14-2009 01:19 AM
bash script path issue - how to pass a path as a string to a variable PiNPOiNT Programming 5 04-17-2009 05:48 PM
java -version, bash: java: command not found kirman Programming 4 03-19-2008 11:13 PM
java path in bash matador Mandriva 2 12-03-2003 08:51 AM


All times are GMT -5. The time now is 01:53 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration