![Share on Facebook Facebook](https://www.rootlinks.net/wp-content/plugins/social-media-feather/synved-social/image/social/regular/48x48/facebook.png)
![Share on Twitter twitter](https://www.rootlinks.net/wp-content/plugins/social-media-feather/synved-social/image/social/regular/48x48/twitter.png)
![Share by email mail](https://www.rootlinks.net/wp-content/plugins/social-media-feather/synved-social/image/social/regular/48x48/mail.png)
ちょっとハマったのでメモ
1 2 3 4 5 6 7 8 9 10 11 12 |
[root@host1 ~]# vi test.sh [root@host1 ~]# cat test.sh #/bin/sh FILENAME=Hello EXTENSIONS=WORLD.txt echo $FILENAME_$EXTENSIONS echo ${FILENAME}_${EXTENSIONS} echo $FILENAME'_'$EXTENSIOS echo ${FILENAME}'_'${EXTENSIONS} echo $FILENAME\_$EXTENSIONS |
1 2 3 4 5 6 |
[root@host1 ~]# /bin/sh test.sh WORLD.txt Hello_WORLD.txt Hello_ Hello_WORLD.txt Hello_WORLD.txt |
_(underscore)を使う機会が殆ど無かったけどファイル名に使用しているものの処理をシェルで書いていたらハマった
これは知らなかった..$_関係かなぁ
unix shell programming special variables
http://stackoverflow.com/questions/3206312/unix-shell-programming-special-variables