Basically, i need to unset DISPLAY variable in screen if I run multiple commands like:

screen -dmS name bash -c 'kodi; unset DISPLAY; emulationstation'

I'm writing a little something that will autorun kodi on boot after all my mountpoints, and when kodi exits it will run emulationstation. But emulationstation will not run if the $DISPLAY variable is set for some reason and I need it to be in screen because some options are apparently not available if not running inside screen.

But unset DISPLAY doesn't work for some reason. I've even tested it by running this:

screen -dmS emu bash -c "echo Display=$DISPLAY
echo Display=$DISPLAY

And when I reconnect to 'emu' it will always display :0.0 even after unset.

  • 3
    variables are being expanded by your local shell inside double quotes. – Stéphane Chazelas May 16 at 10:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.