Re: [問題] 請問shell的問題
※ 引述《whisp1222 ()》之銘言:
: script第一行的#!XXX是可以用來指定該shell script的檔案要用哪一個shell下去執行
: 例如說 #!/bin/tcsh是指定用tcsh下去跑這個script
: 但是假設說我要執行 a.sh
: a.sh 第一行用 #!/bin/tcsh
: 而我在bash中用source a.sh
: 可是他不會用tcsh下去跑 甚至還會出現錯誤(因為bash 跟 tcsh與法不同)
: 請問我的觀念是哪邊錯了
source 的時候是在 "現在的 shell 裡面去執行"
man bash 就可以看見這一段
source filename [arguments]
Read and execute commands from filename in the current shell
environment and return the exit status of the last command
executed from filename.
也就是說你把 tcsh 的語法讀進 bash 叫 bash 去執行
--
隨手關電腦,救救北極熊
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.57.131.211
推
09/21 11:44, , 1F
09/21 11:44, 1F
討論串 (同標題文章)