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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:59:14+00:00 2026-06-08T22:59:14+00:00

I tried running a script file using bash but it showed an error bash-3.2$

  • 0

I tried running a script file using bash but it showed an error

bash-3.2$ example.sh : command not found

I also tried
ls -l example.sh

I found that it was not executable, so I used
sudo chmod 777 example.sh

I again tried running it but same error was coming. I double checked that I am in the same folder as the file using ls. But still I am not able to execute the script file.

I finally tried making a dummy script file and running it , and found the same error

I think there is some problem with BASH. Can some one help me with what is the problem?

I am working on redhat, bash was already installed in my system

Since I am newbie on linux any help would be appreciated

  • 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-08T22:59:16+00:00Added an answer on June 8, 2026 at 10:59 pm

    bash search for commands in your $PATH. Apparently the current directory, ., is not in your $PATH. (This is a good thing; having . in your $PATH is insecure.)

    You’ll need to specify a directory name. Just type:

    ./example.sh
    

    Incidentally, doing:

    sudo chmod 777 example.sh
    

    is two kinds of overkill. First, you don’t need to use sudo; use sudo only when you actually need to. Presumably your personal account owns the file, so you can just use chmod directly.

    Second, 777 is way too permissive. It allows anyone on the system to read, execute, or modify example.sh. (If you’re the only person on the system it may not matter much, but it’s still a bad habit.) Typically you should use 755 for directories and for files that need to be executable, and 644 for files that don’t need to be executable.

    Or just use

    chmod +x example.sh
    

    to set execute permission (your umask will prevent that from setting the permissions too loosely).

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

Sidebar

Related Questions

I tried running a python script: print Hello, World! And I get this error:
I tried to modify the sintax using 2to3 tool by running command python C:\Python32\Tools\scripts\2to3.py
I've tried running the debugger in VS. I see the error list, but I
Here is the script that I want to run using git filter-branch : #!/bin/bash
I am generating new xml file using perl script but I have small problem,
I have a long-running Python script that I run from the command-line. The script
I'm running a script on a remote server like using this command: ssh root@host
I need to test a perl script in a remote server. I tried running
I tried running the following python code in Eclipse on Windows but it is
I have XAMP installed on my mac and I tried running the command -

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.