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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:22:43+00:00 2026-05-16T23:22:43+00:00

from /lib/lsb/init-functions (maybe this file is debian specific, but doesn’t really matter for the

  • 0

from /lib/lsb/init-functions (maybe this file is debian specific, but doesn’t really matter for the question):

pidofproc () {
    local pidfile line i pids= status specified pid
    pidfile=
    specified=

Whats the difference between saying

local a

and

local a=

?

  • 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-16T23:22:44+00:00Added an answer on May 16, 2026 at 11:22 pm

    Both types remove any external versions of the variables from the scope.
    The = assigns a null value to the variable, whereas the bare form leaves the variable unset.

    For example:

    A=30
    B=30
    
    function foo()
    {
        local A B=
        echo A - $A
        echo B - $B
        echo A :- ${A:-minusA}
        echo B :- ${B:-minusB}
        echo A :+ ${A:+plusA}
        echo B :+ ${B:+plusB}
        echo A hash ${#A}
        echo B hash ${#B}
    
    
        echo A - ${A-minusA}
        echo B - ${B-minusB}
        echo A + ${A+plusA}
        echo B + ${B+plusB}
    
    
        ## Modifies variable
        echo A := ${A:=eqA}
        echo B := ${B:=eqB}
        echo A - $A
        echo B - $B
    }
    
    foo
    

    Output:

    A -
    B -
    A :- minusA
    B :- minusB
    A :+
    B :+
    A hash 0
    B hash 0
    A - minusA
    B -
    A +
    B + plusB
    A := eqA
    B := eqB
    A - eqA
    B - eqB
    

    You can see the section:

        echo A - ${A-minusA}
        echo B - ${B-minusB}
        echo A + ${A+plusA}
        echo B + ${B+plusB}
    

    is different for A and B.

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

Sidebar

Related Questions

In Python, I'm getting an error because it's loading a module from /usr/lib/python2.6/site-packages but
I change schema.yml from time to time and execute: symfony propel:build-all-load but the lib/_model
I'm updating a project from VS2008 to VS2010 and I'm getting this error: uafxcwd.lib(afxwinappex.obj)
I have mail.py file: # coding: utf-8 from ..lib.common import * from ..lib.common import
I use the play-gae module. I tried to delete this jar from lib directory
[Cross-posted from lib-curl mailing list] I have a single threaded app (MSVC C++ 2005)
I tried to port code some from the FANN Lib (neuronal network written in
I am working on porting a large number of .h and .lib files from
Is there any good JAVA lib for playing with reading from WSDL's and connecting
I use use lib ./DIR to grab a library from a folder elsewhere. However,

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.