0

I have gone through the following steps.

  1. Made the file executable,
  2. Tested that the file could be run with ./script1.py,
  3. Added the file's directory to the system $PATH.

However, at this point, am I supposed to be able to say script1 arg1 and be able to run it like a built-in bash command or do I still need to set up an alias.

My quick hack is to set up an alias; however, I am not sure if this is redundant.

alias script1 = $HOME/dir/script1.py
Jerry
  • 70,495
  • 13
  • 100
  • 144
user1431282
  • 6,535
  • 13
  • 51
  • 68

1 Answers1

1
mv script1.py script1

should do the trick. I won't recommend it though.

A better way is to add a symblic link:

ln -s script1.py script1

This way, you can add the link directly in some system path - probably /usr/bin - and won't need to change $PATH at all:

sudo ln -s script1.py /usr/bin/script1

Make sure it will not override any existing file.

Elazar
  • 20,415
  • 4
  • 46
  • 67