請問shell的問題 - Linux

Table of Contents


script第一行的#!XXX是可以用來指定該shell script的檔案要用哪一個shell下去執行

例如說 #!/bin/tcsh是指定用tcsh下去跑這個script

但是假設說我要執行 a.sh

a.sh 第一行用 #!/bin/tcsh

而我在bash中用source a.sh

可是他不會用tcsh下去跑 甚至還會出現錯誤(因為bash 跟 tcsh與法不同)

請問我的觀念是哪邊錯了

--

All Comments

Agnes avatarAgnes2009-09-23
source 有類似 include 的效果(的樣子)
Cara avatarCara2009-09-25
試試直接執行