You are not logged in.

#1 2019-04-14 18:57:52

phraggers
Member
Registered: 2019-04-07
Posts: 3

gnome terminal: open program or script in current directory

Not sure if I've configured something wrong, but googling this post title comes up with "how to open terminal at x directory" or stuff about startup. Basically in other terminals as far as I remember, you can cd into a directory, and then just type the name of an executable or script in that directory and it will open. However that's not the case with my current setup, gnome-terminal --version gives: "GNOME Terminal 3.32.1 using VTE 0.56.1 +GNUTLS"

When I cd into a directory containing, for example, script.sh, i type "script.sh" I get "bash: script.sh: command not found". I understand the basics of how "path" works, but I thought that current directory should be in the path. If not, how do I change this?

Offline

#2 2019-04-14 19:14:51

cirrus
Member
From: Glasgow Scotland
Registered: 2012-08-24
Posts: 341
Website

Re: gnome terminal: open program or script in current directory

Try  ./foo.sh. ensure it’s executable. Idk about previous set up but if bash script named foo is in path then typing foo in TE would execute it.

Last edited by cirrus (2019-04-14 19:17:20)

Offline

#3 2019-04-14 19:39:37

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,520

Re: gnome terminal: open program or script in current directory

That has nothing to do w/ the TE but the shell (bash, in your case)

I thought that current directory should be in the path

The general consensus is that  this is a rather stupid idea, certainly as a default. See eg. https://unix.stackexchange.com/question … h-how-come or https://superuser.com/questions/156582/ … by-default and various similar threads on the interwebs.

My 2¢: "Don't."

Online

#4 2019-04-14 19:50:53

cirrus
Member
From: Glasgow Scotland
Registered: 2012-08-24
Posts: 341
Website

Re: gnome terminal: open program or script in current directory

seth wrote:

My 2¢: "Don't."

I agree with this ~/bin or ~/scripts would suffice.

see  What are “$PATH” and “~/bin”? How can I have personal scripts?
and
Environment variables - ArchWiki

Offline

#5 2019-04-14 20:01:29

phraggers
Member
Registered: 2019-04-07
Posts: 3

Re: gnome terminal: open program or script in current directory

Thanks for the replies! I appreciate the advice, if I'm generating a bunch of test files (testing some code or whatever) I tend to keep the compiled executables in separate directories, but I guess it doesn't require that much effort to type different directory names.

edit: sorry I'm kinda new, Do I need to edit this topic to be closed or solved or whatever?

Last edited by phraggers (2019-04-14 20:02:29)

Offline

#6 2019-04-14 22:40:29

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: gnome terminal: open program or script in current directory

phraggers wrote:

edit: sorry I'm kinda new, Do I need to edit this topic to be closed or solved or whatever?

Edit your first post and add [SOLVED] to the title.

How to Post

Offline

Board footer

Powered by FluxBB