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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:31:38+00:00 2026-06-18T03:31:38+00:00

In a shell, what is the difference between? . executable and ./executable In the

  • 0

In a shell, what is the difference between?

. executable

and

./executable

In the first one, the dot a shortcut for source right? So is there a difference between ./executable and source executable?

  • 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-18T03:31:39+00:00Added an answer on June 18, 2026 at 3:31 am

    is there a difference between ./executable and source executable?

    basic difference is,

    ./foo.sh      - foo.sh will be executed in a sub-shell
    source foo.sh - foo.sh will be executed in current shell
    

    some example could help to explain the difference:

    let’s say we have foo.sh:

    #!/bin/bash
    VAR=100
    

    source it:

    $ source foo.sh 
    $ echo $VAR
    100
    

    if you :

    ./foo.sh
    $ echo $VAR
    [empty]
    

    another example, bar.sh

    #!/bin/bash
    echo "hello!"
    exit 0
    

    if you execute it like:

    $ ./bar.sh
    hello
    $
    

    but if you source it:

    $ source bar.sh
    <your terminal exits, because it was executed with current shell>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In shell scripts, what is the difference between $@ and $* ? Which one
Possible Duplicate: Shell Programming: What's the difference between $(command) and command It seems there
I encounter one problem about the file system in the shell. what's difference between
I am a shell script newbie. I want to know the difference between ${var%pattern}
As mentioned in several forums and here, on stackoverflow , there's no difference between
I've seen somewhere that we can use >> in shell. What's the difference between
Please tell me what is the difference in bash shell between launching a script
What is the difference between sh and source ? source: source filename [arguments] Read
Can anyone explain me difference in python shell between output variable through print and
What is difference between Shell(App.Path & \ & Hello.exe) and Shell(Hello.exe) If I put

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.