Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6707285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:37:16+00:00 2026-05-26T07:37:16+00:00

I have been trying to run some java programs from a bash script in

  • 0

I have been trying to run some java programs from a bash script in msys on a windows machine. Specifically, I am automating some tasks using WEKA on command line. I have some problems where a quoted string is not passed correctly to java. The actual code loops through an array of commands to run. Here is a stripped down version, i.e. a single iteration where $RUN contains the array element string.

#!/bin/bash

export CLASSPATH=CLASSPATH:weka.jar:libsvm.jar

RUN="java weka.classifiers.functions.LibSVM -S 0 -K 2 -D 3 -G 0.0 -R 0.0 -N 0.5 -M 1000.0 -C 1000000.0 -E 0.0010 -P 0.1 -Z -W '1 2' -t trainFile.csv -T testFile.csv "

# does not work, returns => Weka exception: For input string: "'1"
$RUN  > reportFile.txt

RUN="java weka.classifiers.functions.LibSVM -S 0 -K 2 -D 3 -G 0.0 -R 0.0 -N 0.5 -M 1000.0 -C 1000000.0 -E 0.0010 -P 0.1 -Z -W \"1 2\" -t trainFile.csv -T testFile.csv "

# does not work, returns => Weka exception: For input string: ""1"
$RUN > reportFile.txt

RUN="java weka.classifiers.functions.LibSVM -S 0 -K 2 -D 3 -G 0.0 -R 0.0 -N 0.5 -M 1000.0 -C 1000000.0 -E 0.0010 -P 0.1 -Z -t trainFile.csv -T testFile.csv "

# works without the string argument for -W
$RUN  > reportFile.txt

It seems the the problem is the string "1 2" is broken into two arguments. How can they be combined into one argument?

I am using Windows 7, msys with the mintty terminal.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:37:17+00:00Added an answer on May 26, 2026 at 7:37 am

    Try this workaround:

    RUN="weka.classifiers.functions.LibSVM -S 0 -K 2 -D 3 -G 0.0 -R 0.0 -N 0.5 -M 1000.0 -C 1000000.0 -E 0.0010 -P 0.1 -Z -W \"1 2\" -t trainFile.csv -T testFile.csv"
    echo $RUN | xargs java > reportFile.txt
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to call some functions from a library provided by a
I have been messing with Oracle DB queries that run from my JAVA app.
I have been trying to add columns to a table using some logic that
I have been trying to migrate a database from Sybase to MySQL. This is
Over the past few days I have been trying to create/run a project in
I have been receiving errors when trying to save and run this Python 3.1
I have been having some problems trying to get my PHP running. When I
I've been trying to implement unit testing and currently have some code that does
I have been trying to declare variables inside a For loop for quite some
I am modifying a Nant build script to run some unit tests. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.