Start an app using non-interactive shell
Hello,
I am using i3 for some time and I am happy. Today I have discovered one interesting thing - I have a script i3/autostart which I start using the following method:
exec ~/.i3/autostart
The script has /bin/sh shebang, because I do not want to load up my environment at this point. And my $SHELL variable is /bin/bash of course.
Now there is one issue, because i3 tries to load using $SHELL or /bin/sh. I do have my shell set to bash (I use Bash as the main shell), but I want to autostart via /bin/sh (or bash --norc - that is the same thing). And I think I am unable to do it. I am thinking about a workaround, but can't find anything.
The issue I have is I am not able to completely exit the environment, e.g. when I close my terminal and I want to start over with freshly modified .bashrc, I can't do it, because my new forked shell will inherit all the variables from this ueber-shell.
Also when I do things like
PATH=$PATH:/xyz/xyz
it is added twice then.
Do you know about any solution? Thanks.
Why do you set the SHELL environment variable to bash when all you need is an entry in /etc/passwd to make bash the login shell for your user account?
I dont set it of course, I just mean it is set to /bin/bash (but I am not setting it).
Then set it to /bin/sh explicitly?
This is strange, something is not correct and I don't know what. I need to investigate if bash -c parameter reads my profile or not.