Skip to content

Instantly share code, notes, and snippets.

@178inaba
Last active August 29, 2015 14:24
Show Gist options
  • Save 178inaba/0514d2209d7db770863e to your computer and use it in GitHub Desktop.
Save 178inaba/0514d2209d7db770863e to your computer and use it in GitHub Desktop.
シェルスクリプト変数のホームディレクトリ展開 ref: http://qiita.com/inaba178/items/3027defbc2aabaefab84
$ sh var.sh
A=/Users/user_name/.get
B=~/.get
C=~/.get
D=/Users/user_name/.get
E=$HOME/.get
#!/bin/sh
# substitution
A=~/.get
B="~/.get"
C='~/.get'
D="$HOME/.get"
E='$HOME/.get'
# result
echo "A="$A
echo "B="$B
echo "C="$C
echo "D="$D
echo "E="$E
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment