LInux mint does not execute scipts[SOLVED]

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
pksucks

LInux mint does not execute scipts[SOLVED]

Post by pksucks »

I have written a simple script
#! /bin/bash
echo "Hello World"

the script is saved as file.sh

when i do
chmod u+x file.sh
to make it executable and then type file.sh on te terminal it says
file.sh: command not found

why? Doesn't Linux mint support shell scripting ?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
remoulder
Level 17
Level 17
Posts: 7621
Joined: Fri May 09, 2008 1:14 pm

Re: LInux mint does not execute scipts

Post by remoulder »

pksucks wrote:why? Doesn't Linux mint support shell scripting ?
Before you start to make accusations of things not working, perhaps you should learn how to do things properly? The way to run a .sh file is sh <path>/<filename>.sh - note the <path>, if the file is in the current directory you have to put '.' as the path (without the quotes).
[Edit] your original post and add [SOLVED] once your question is resolved.

“The people are my God” stressing the factor determining man’s destiny lies within man not in anything outside man, and thereby defining man as the dominator and remoulder of the world.
pksucks

Re: LInux mint does not execute scipts

Post by pksucks »

Thanks I was silly not to use ./filename. I was using filename :)
Locked

Return to “Beginner Questions”