The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
0

What shell does ‘exec’ actually use and how can I change it?

asked Aug 8 '15

k.stm gravatar image

updated Aug 8 '15

This might be a non-i3-question after all.

In the i3 docs, it says that

“What good is a window manager if you can’t actually start any applications? The exec command starts an application by passing the command you specify to a shell,”

but what shell are the commands actually passed to? My user’s shell is set to /bin/zsh, but apparently exec invokes command via /bin/sh. How can I change that?

I use debian testing/unstable, should that matter.

Background: I use an i3 key binding to invoke urxvtcd -e emacs -nw, but evaluating (getenv "PATH") from within emacs gives me then the wrong environment (whereas (getenv "SHELL") gives me /bin/zsh).

1 answer

Sort by » oldest newest most voted
2

answered Aug 8 '15

Airblader gravatar image

i3 uses /bin/sh because this is available everywhere. You cannot modify this. Leaving aside the question of why your /bin/sh doesn't just point to zsh, you can do this:

exec /bin/zsh whatever.sh

Comments

Or `exec zsh -c whatever`. Ok.

k.stm gravatar imagek.stm (Aug 9 '15)edit

Question Tools

1 follower

Stats

Asked: Aug 8 '15

Seen: 283 times

Last updated: Aug 08