Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 2
    Why do you need the -i? Why can't you just run sudo ./myscript? Commented Mar 30, 2021 at 7:13
  • sudo and sudo -i have different env, and it needs the env of sudo -i Commented Mar 30, 2021 at 7:17
  • 1
    Please edit your question and explain what you need. Using sudo -i like that doesn't make much sense, so we need to understand why you think that is the solution. Can't you just run sudo -i /home/user/myscript.sh? More importantly, why would you need root's login environment? Commented Mar 30, 2021 at 7:59
  • 1
    @yoon, I edited to add that comment in to the question, since it seems rather an important point as to why you're doing this. In general, you can edit to add clarifications to the question itself. (Information in comments can be missed easily.) Commented Mar 30, 2021 at 9:30