0

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

PATH="$PATH:~/Desktop/name"

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

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.