shell script 的執行方式 - Linux

Table of Contents

各位高手:

請問

. ./xxx.sh (兩個'.'中間空一格)



./xxx.sh

有什麼不同呢?謝謝!

--

All Comments

Tom avatarTom2010-09-16
第一個等價於source ./xxx.sh
Frederica avatarFrederica2010-09-16
.是 bash 的 source 其他 shell 不一定會有
Joe avatarJoe2010-09-19
如果user的shell是csh就會command not found
Kumar avatarKumar2010-09-23
鳥哥->Linux基礎文件->13.學習shell script ->拉到標題是
Elvira avatarElvira2010-09-27
script 的執行方式差異 (source, sh script, ./script)這邊
Charlie avatarCharlie2010-09-29
記住,鳥哥是大家的好朋友,年輕人不可以不會STFW喔.
Barb Cronin avatarBarb Cronin2010-10-03
.是用目前使用的bash來執行你的script
直接執行的話會新開一個bash
Steve avatarSteve2010-10-07
比較大的差別大概是沒有export的變數會不見吧
Jessica avatarJessica2010-10-07
二樓你確定嗎, source是bash拿csh過去用的
James avatarJames2010-10-08
csh比較老~~
Caroline avatarCaroline2010-10-10
用. 是使用當前的shell不是使用bash@@