Created
February 20, 2013 04:19
-
-
Save thinkerbot/4992850 to your computer and use it in GitHub Desktop.
The miracle of exec for passing ENV among programs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export A=a | |
exec ./b.rb | |
echo not here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
ENV["B"] = "b" | |
exec "./c.zsh" | |
puts "not here" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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