0

In a bash script that is called with sudo i am calling:

/usr/bin/firefox -new-tab http://stackoverflow.com

but then i get the message:

Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system

this is, i guess, because the script is called by sudo and firefox by the normal user. if i would call the command without sudo it works.

so how can i switch back to the normal user in a sudo called script?

1
  • The su(1) command is used to change user id. I recall that Ubuntu makes it difficult to use, but most other systems include and support it. Commented Jun 30, 2011 at 15:27

2 Answers 2

2

using sudo again inside your script.

sudo -u user -H /usr/bin/firefox -new-tab http://stackoverflow.com
Sign up to request clarification or add additional context in comments.

Comments

0

This post might answer your question

1 Comment

wow, i was actually thinking about something that can be done in the script itself, any chance?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.