Skip to content

Instantly share code, notes, and snippets.

@Epictetus
Forked from cosmo0920/exec_bash.rb
Created March 20, 2012 22:27
Show Gist options
  • Save Epictetus/2141936 to your computer and use it in GitHub Desktop.
Save Epictetus/2141936 to your computer and use it in GitHub Desktop.
Rubyからbash実行?
#bashシェルを埋め込んでみた。
#必要なヘッダーが有る時はなにもしないよ
fixshContent=
"#!/usr/bin/env bash\n
cd arch/x86/include/asm/\n
if [ -f unistd_32.h ] ; then
echo 'no need fix.'
else
ln -s ../generated/asm/unistd*.h .\n
fi"
print "creating symlinkfix....\n"
exec("echo #{fixshContent}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment