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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:05:36+00:00 2026-05-28T14:05:36+00:00

I expect set — a b to set $1 = a and $2 =

  • 0

I expect

set -- "a b"

to set $1 = "a" and $2 = "b", but instead it’s setting $1 = "a b" and $2 = "" what gives?

  • 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-28T14:05:37+00:00Added an answer on May 28, 2026 at 2:05 pm

    The double quotes indicate that "a b" should be treated as a single parameter. Use

    set -- a b
    

    to treat them as two parameters.

    Edit in response to your comment: Like this?

    $ a="a b"
    $ set -- $a
    $ echo $1
    a
    $ echo $2
    b
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have set up multiple targets in a single xml file. I expect all
I don't expect a straightforward silver bullet answer to this, but what are the
Ok, I usually do this in reverse, post a specific data set, then expect
I read the following code, but I do not understand how it works: set
9 times out of 10, simply using Map and Set behave like I expect
I wanna set block dsiplay:block every where in the site for input expect in
I am writing some expect commands in bash. Script: #!/bin/bash set timeout -1 expect
I would expect there to be three lines of output from this code, but
What is the difference between this: ResultSet set = EasyMock.createNiceMock(ResultSet.class); EasyMock.expect(set.getInt(col1)).andReturn(1); EasyMock.expect(set.wasNull()).andReturn(false); EasyMock.expect(set.getInt(col2)).andReturn(2); EasyMock.expect(set.wasNull()).andReturn(false);
function expect_password { expect -c \ set timeout 90 set env(TERM) spawn $1 expect

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.