Skip to content

Instantly share code, notes, and snippets.

@yaasita
Last active September 6, 2019 04:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yaasita/184822733558cdcad73632adf7a8cf02 to your computer and use it in GitHub Desktop.
Save yaasita/184822733558cdcad73632adf7a8cf02 to your computer and use it in GitHub Desktop.
#!/bin/bash
export MAIN1="exportした変数"
MAIN2="普通の変数"
exec ./sub.sh
echo "この行は実行されない"
#!/bin/bash
export MAIN1="exportした変数"
MAIN2="普通の変数"
source ./sub.sh
echo "この行は実行される"
echo $SUB1
echo $SUB2
#!/bin/bash
echo $MAIN1
echo $MAIN2
export SUB1="subでexportした変数"
SUB2="subの普通な変数"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment