DEV Community

sam
sam

Posted on

GOT snobbed by my local bin

Hello devs,

How's everyone doing ?

So I wrote the following script

A screenshot of the C script

I had open-typer downloaded and just wanted a shorter way to run the AppImage. I made it an executable. That's when I wrote the script above coz the name was too long. I'm not a fun of long names.

I then moved the executable to bin,
so that I could run it from anywhere without the './' thingies
(video down below)

But when I tried to run it
Nothing happenned.
The executable was fine but bin didn't actually seem to care about it
I mean the other ones worked just fine.
So here I am, I need your help techies or whoever you are,
Also he ate the pixels

Top comments (7)

Collapse
 
csm18 profile image
csm • • Edited

In Linux, all system software binaries (exe files) are put in some predefined locations.
Our terminal shell knows about those locations through PATH environemnt variable.
Run this and you can see all the paths:

echo $PATH
Enter fullscreen mode Exit fullscreen mode

And actually type is the command to know about from where a command is being used, like :

type gcc
Enter fullscreen mode Exit fullscreen mode

It will print the path to the command.
If there are more than 2 binaries with same name in PATH folders, then it will show the precedence, like which one will it run!

Collapse
 
csm18 profile image
csm • • Edited

Its not working, because, in linux there is already a command named type !
Rename it to something like typer !

Collapse
 
csm18 profile image
csm •

Try this and you will see the command's help:

Collapse
 
samstag profile image
sam •

ok lemme try that

Collapse
 
samstag profile image
sam •

I actually got it working, the appimage that is, got a software that takes the appimage and lets me access it from the software center, also I wrote the script so that I could save it on my local bin and call the program from wherever I was in the directories. But tell me more about this type! command

Collapse
 
csm18 profile image
csm •

Ok, first of all i want to ask some questions, if you don't mind!

Collapse
 
samstag profile image
sam •

you're free to ask