Convert
Posts: 7
Joined: Sat Jun 16, 2018 12:58 pm

Running a command [solved]

Mon Jun 18, 2018 2:46 pm

Hi there,

A question about running a command (or program; an executable in any case).

Is it possible to execute a command which resides in the current Working Directory?
The Working Directory is not part of the PATH environment variable.
When trying to do so, I get a message 'command not found'.

a Convert
Last edited by Convert on Mon Jun 18, 2018 7:17 pm, edited 1 time in total.

jbudd
Posts: 1446
Joined: Mon Dec 16, 2013 10:23 am

Re: Running a command

Mon Jun 18, 2018 2:48 pm

./command
/fullpathname/command
export PATH=$PATH:. ; command

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Running a command

Mon Jun 18, 2018 3:00 pm

Use the "dot slash commandname" feature of the shell.
./commandname
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Convert
Posts: 7
Joined: Sat Jun 16, 2018 12:58 pm

Re: Running a command

Mon Jun 18, 2018 6:34 pm

Thanks (again) guys! This works indeed.

a Convert

Return to “Beginners”