I want to start script just by typing script not the full path of the script for example ~/Desktop/name/script so i tried to edit variable PATH


in the name folder i have a script called "script". When i want to run script just by typing script it says Script started, file is typescript and create an empty typescript file in my pwd.


1 Answer 1


Most likely the program script is already installed, check whereis script for its location and man script for what it does.

There are several possibilities to make your program work as you intended:

  1. Simply by changing the name form script to a unique program name not used yet. The simplest method, which will also make sure that you do not "deactivate" some programs (for your shell environment).
  2. The PATH variable is read front to end. So if there are two script executables to be found the first match will be taken. You can change your path as PATH="~/Desktop/name:$PATH" so your script will be the first hit. The original script would then always have to be executed by an absolute path e.g. /usr/local/bin/script
  3. You could introduce an alias for script like (bash syntax) alias script='/home/user/Desktop/name/script'. Besides the absolute path for executing the original script program, an alias can also be escaped by \script to match the original non-alias behaviour.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .