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 8926319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:56:43+00:00 2026-06-15T07:56:43+00:00

I am running my script in different environments and therefore I store the path

  • 0

I am running my script in different environments and therefore I store the path and name of program I want to start in variable $CreateSequenceDictionary.

This program uses parameters R= and O= for this reason I put the whole command in quotations “”. Without these, program is started without any paramaters.

And now my problem: instead of $reference I would like to pass content of this variable. I tried this:

"java -jar $CreateSequenceDictionary R=$reference O=output" >mlogfile

and many variations (such as “ “” eval \) with no success.

Please, how should I adjust my command so I could run program stored in variable with parameter stored in variable?

EDIT: If I should use command in terminal, it would look like this:

 java -jar /path/CreateSequenceDictionary.jar R=input O=output

However, I want to get name of the program from variable and also name of input file from variable.

  • 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-06-15T07:56:44+00:00Added an answer on June 15, 2026 at 7:56 am

    You can do that without the surrounding quotes.

    java -jar $CreateSequenceDictionary R=$reference O=output > mlogfile
    

    Bash will expand the vars before running the command.

    If you want to conditionally include the R= and O= options, you could try something like this:

    CreateSequenceDictionary="your_Program"
    r_option ="$reference"
    o_option="output"
    
    arguments=()
    [[ "$r_option" ]] && arguments+=("$r_option")
    [[ "$o_option" ]] && arguments+=("$o_option")
    
    java -jar $CreateSequenceDictionary "${arguments[@]}" > mlogfile
    

    This builds the additional arguments on-the-fly and skips those where the associated *_option variable is empty.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a console program that has different components that run like this: void
I have a site running in a few environments on different URLs (i.e. dev.mysite.com
I'd like to execute a shell command starting a long-running script from node and
Like many others Knockout developers before me, I encountered a slow running script warning
Running my script through Devel::NYTProf showed that the following portion of code took up
I am running a script that animates a plot (simulation of a water flow).
I have a script running a batch of very similar queries. All of them,
I have a PHP script running on my LAMP server that requires certain files
I have a python script running on a small server that is called in
I have the following script running successfully. However if I try to use a

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.