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

  • Home
  • SEARCH
  • 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 8127517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:33:33+00:00 2026-06-06T07:33:33+00:00

ssh $hname cd /opt/tomcat/webapps/aware/WEB-INF/classes/com && for FNAME in `tar tvf /tmp/prop.tar | awk ‘{print

  • 0
ssh $hname "cd /opt/tomcat/webapps/aware/WEB-INF/classes/com && for FNAME in `tar tvf /tmp/prop.tar | awk '{print $6}'` 
do
  if test ! -s "/tmp/$fname/prop_bkup.tar"
  then
    ls $FNAME && tar cvf /tmp/$fname/prop_bkup.tar $FNAME && rm $FNAME || echo "$FNAME is a new file".
  else
    ls $FNAME && tar uvf /tmp/$fname/prop_bkup.tar $FNAME && rm $FNAME || echo "$FNAME is a new file".
  fi
done"

Above for loop is not working in remote host. Can anyone please help me on this?

  • 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-06T07:33:34+00:00Added an answer on June 6, 2026 at 7:33 am

    I’ve edited you question to put the code into a code block. In the mean time, I can see a few potential problems:

    1. Use single quotes around the main command to prevent your local
      shell filling in the variables. This will also be causing problems
      with the double quotes in the remote command.
      If you change to single quotes, you’ll need to make sure you’ve still quoted the awk argument properly.
    2. You’ve used both lowercase $fname and uppercase $FNAME – they should all be the same ($FNAME in this instance).

    You need to explain what you mean by “not working”. This will give you much better answers.

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

Sidebar

Related Questions

system(ssh test.host.com); its asking for permentaly add key or not ? I want automatically
I wanna tunnel my ssh though port 80(listened by apache). mod_proxy & mod_proxy_connect provide
I want to implement ssh terminal client in web browser. I need to implement
I've opened a ssh tunnel with ssh -D localhost:5678 me@server.com and I want to
why is SSH not working? I keep getting.. ssh: connect to host ec2-11-11-11-11.compute-1.amazonaws.com port
ssh pvuser@host '. ~pvuser/.profile;/opt/datamart/bin/resmgr -import segp -colNames npath cond type -line ~Thresholds~Transmission_Auto|_|$r|_|rule|_|' I am
When I enter ssh-keygen -t rsa -C your@email.com in git it gives a Too
I am writing an SSH client using only bash (as much as possible) and
Im trying to SSH from Java to a server and run multiple commands. the
While working with ssh I sometimes write to long string/commands eg. command -param 3

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.