Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to launch Intellij IDEA IDE via sudo idea.sh. sudo because IDE needs to manupulate files from /etc/share. idea.sh is placed at /home/<username>/<path>/bin/idea.sh.

I tried to add this path to PATH environment variable by adding export PATH="$PATH":<path-to-idea>/bin to /etc/profile or by changing string in /etc/environment from PATH="blahblah" to PATH="<path-to-idea>/bin:blahblah". In both cases after sudo echo $PATH command I got string with my path to IDEA added.

But when I tried to execute idea.sh via sudo idea.sh I got sudo: idea.sh: command not found. What am I doing wrong?

share|improve this question
    
Try sudo -E idea.sh to preserve your environment. You may get an error. –  glenn jackman Feb 21 at 23:04
    
the same result –  kassie Feb 21 at 23:10
    
sudo -i idea.sh will do –  user224465 Feb 21 at 23:52
    
-bash: idea.sh: command not found –  kassie Feb 21 at 23:54
    
Easier to place the script in /usr/local/bin. –  Gunnar Hjalmarsson Feb 22 at 5:32

1 Answer 1

Just to run:

sudo ./idea.sh

in background:

sudo ./idea.sh &

Also visit similar answer.

share|improve this answer
    
sudo: ./idea.sh: command not found. –  kassie Feb 22 at 19:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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