M
M
Marat Taganov2021-01-31 19:10:33
linux
Marat Taganov, 2021-01-31 19:10:33

How to run a shell script with one command?

I have a bash script that I want to make in the form of a wifite program so that it can be run with one command, for example wifite starts like this: wifite, how to do the same but only with my script

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Karbivnichy, 2021-01-31
@Lunatik-cyber

alias

L
Lesha, 2021-01-31
@hydrugz

You can move it to one of the standard directories for executable files, be it /bin, /usr/bin, /usr/local/bin, $HOME/user/bin, etc. with the necessary rights. But for you, it would be preferable to use an alias that has already been chosen as a solution so as not to break anything

S
Saboteur, 2021-01-31
@saboteur_kiev

1. put the script in PATH
2. make an alias and add it to the shell config file (in .bashrc or .profile)
3. As point two, just make a function. It is possible to put a script actually in it. A function is preferred over an alias - it can be called from other scripts.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question