Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There is a command inside my


i am not sure why it is not being executed.

i think i either need to add #!bash or something on top of the script
or perhaps i need to add gnome-terminal infront of the line being executed.

but is there a way to find out what the error is?

this is the command by the way:

/usr/X11R6/bin/xautolock -time 1 -locker "/root/shut_off"

works fine via terminal.

share|improve this question
Not #!bash. Look up shebang. Summarised, if you have an executable script which needs bash to interpreted it then the first line should be either point to the interpreter (e.g. #!/usr/local/bin/bash) or #!/usr/bin/env bash. The latter is more portable. – Hennes Sep 1 '13 at 19:00
up vote 1 down vote accepted

You are adding a command that relies on a running X server to a file that is run before the X server has been initialized and will, in any case, not be run by the user who started the server but by root.

What is it you want to do? If you just want that command to be run every time you log in for example, add it to your ~/.profile (or ~/.bash_profile if that file exists and you are using bash).

share|improve this answer

You must log in to answer this question.