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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:36:24+00:00 2026-06-08T18:36:24+00:00

I have created a wrapper which can execute a given script over SSH with

  • 0

I have created a wrapper which can execute a given script over SSH with following parameters

sshwrapper.sh <server> <script with path> <username> <password>

Now i want to invoke the following scripts:

start.sh param1 param2 param3 param4

stop.sh param1 param2 param3

using the same wrapper.

Is it possible to have a mechanism where after passing the essential parameters to wrapper script I can post remaining parameters to underlying script?

i.e. I would like to achieve following notation:

Examples:

sshwrapper.sh server start.sh username password param1 param2 param3 param4 

should invoke

start.sh param1 param2 param3 param4 

and

sshwrapper.sh server stop.sh username password param1 param2 param3 

should invoke

stop.sh param1 param2 param3 

in a generic manner.

  • 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-08T18:36:26+00:00Added an answer on June 8, 2026 at 6:36 pm

    Use shift and "$@":

    SERVER="$1"
    SCRIPT="$2"
    USERNAME="$3"
    PASSWORD="$4"
    shift 4
    
    "$SCRIPT" "$@"
    

    Example:

    $ cat sshwrapper.sh 
    #!/bin/sh
    
    SERVER="$1"
    SCRIPT="$2"
    USERNAME="$3"
    PASSWORD="$4"
    shift 4
    
    echo "$SCRIPT" "$@"
    
    $ ./sshwrapper.sh server stop.sh username password param1 param2 param3 
    stop.sh param1 param2 param3
    

    Using shift you can remove first arguments from command line and shift the rest:

    $ set 1 2 3 4 5
    $ echo "$@"
    1 2 3 4 5
    $ shift 3
    $ echo "$@"
    4 5
    

    You see here that shift 3 removed first three arguments.

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

Sidebar

Related Questions

I have a wrapper managed application(.net) over a COM Component(created using vb6) where Com
Problem We have a DBA provided wrapper script that is used to execute a
I have done the following: Created ContractInterface in ContractProject Created WCFServiceClass in WCFServiceProject which
I have installed SQLite and am using the wrapper from: http://sqlite.phxsoftware.com/ I have created
I have a sample project here on github where I created a c++ wrapper
I have created 3 classes as following Ext.mine.TextParent - Inherting from Textfield Ext.mine.child.TextChildA -
In my Windows API wrapper, I can choose to have a message box come
I have a SQL Server 2008 CTE which is responsible for returning the Top
I have created a C++/CLI mixed DLL which I am using from C# Winforms
I have a C module which is created by the Real-time Workshop based on

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.