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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:51:14+00:00 2026-06-02T04:51:14+00:00

In my script I SSHed a host and tried to run two java programs.

  • 0

In my script I SSHed a host and tried to run two java programs. The first java program runs with nohup and & at the end. After that I try to run another java program but it gives syntax error. I guess it has something to do with the &. I do not want to ssh again.

ssh $host "nohup java -cp daemon.jar:. runtime.daemon.MPJDaemon >>/logs/$host-wrapper.log 2>&1 &;java Health"

It gives
bash: -c: line 0: syntax error near unexpected token `;

Any ideas

  • 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-02T04:51:17+00:00Added an answer on June 2, 2026 at 4:51 am

    In bash, & implies semicolon (;), so you don’t really need that semicolon after the ampersand

    From http://hacktux.com/man/bash

    If a command is terminated by the control operator &, the shell
    executes the command in the background in a subshell.

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

Sidebar

Related Questions

I'm working on a python script that needs to run between two given times.
So I tried executing a script two different ways: 1) foreach($result_array as $arg){ exec(/usr/bin/php
My script is acting strange. After a foreach loop, the script stops. I don't
The script runs fine when stdout/stderr are not redirected. When I add both stderr
java script to alert the mutile option selected ..in <select> HTMl tag. and tag
In a script you must include a #! on the first line followed by
I'm trying to make my python script run upon startup but I get the
I have a script that runs from a newly created shell. OS is Red
I have the following at the end of my script: export PATH=/usr/openwin/bin:/opt/plat/AUTOSYS/4.0/autosys/bin:/usr/kerberos/bin::/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/opt/netezzaClient/bin:/xenv/ant/X/1.8.0/bin:/export/opt/jdk/1.6.0_16/bin:$PATH export JAVA_HOME=/export/opt/jdk/1.6.0_16
I was handed a shell script containing both: java -cp $(CLASSPATH) net.sf.saxon.Transform -xsl:$(CMS_ROOT)/$(TRANSFORMS_DIR)/$(LOCALE_STYLESHEET) \

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.