Skip to content

Instantly share code, notes, and snippets.

@thinkerbot
Created February 20, 2013 04:19
Show Gist options
  • Save thinkerbot/4992850 to your computer and use it in GitHub Desktop.
Save thinkerbot/4992850 to your computer and use it in GitHub Desktop.
The miracle of exec for passing ENV among programs.
#!/bin/bash
export A=a
exec ./b.rb
echo not here
#!/usr/bin/env ruby
ENV["B"] = "b"
exec "./c.zsh"
puts "not here"
#!/bin/zsh
C=c
printf "%s\n" "$A" "$B" "$C"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment