shell script執行方式 - Linux

By Kyle
at 2018-10-05T16:04
at 2018-10-05T16:04
Table of Contents
我寫了一隻簡單的shell script程式 test1.sh
在執行時,不論是 $sh test.sh 或 $./ test1.sh
都可正常執行
但是我看到有人是只打了test1.sh 就可以執行
爬文後判斷是與PATH的當前路徑有關
嘗試將檔案放到bin底下,再下指令test1.sh 也一樣無法執行
不知道有人知道如何改才能只打test1.sh就可以執行嗎
非常感謝
https://imgur.com/P80H1yp.jpg
--
在執行時,不論是 $sh test.sh 或 $./ test1.sh
都可正常執行
但是我看到有人是只打了test1.sh 就可以執行
爬文後判斷是與PATH的當前路徑有關
嘗試將檔案放到bin底下,再下指令test1.sh 也一樣無法執行
不知道有人知道如何改才能只打test1.sh就可以執行嗎
非常感謝
https://imgur.com/P80H1yp.jpg
--
Tags:
Linux
All Comments

By Jack
at 2018-10-08T13:48
at 2018-10-08T13:48

By Ursula
at 2018-10-11T22:55
at 2018-10-11T22:55

By Hedy
at 2018-10-16T02:09
at 2018-10-16T02:09

By Zora
at 2018-10-19T22:06
at 2018-10-19T22:06

By Ingrid
at 2018-10-24T20:31
at 2018-10-24T20:31

By Ina
at 2018-10-25T01:33
at 2018-10-25T01:33

By Audriana
at 2018-10-28T22:29
at 2018-10-28T22:29

By Una
at 2018-11-02T00:37
at 2018-11-02T00:37

By Heather
at 2018-11-03T05:08
at 2018-11-03T05:08

By Barb Cronin
at 2018-11-03T22:18
at 2018-11-03T22:18
Related Posts
如何可以把命令塞入變數內?

By Edith
at 2018-10-05T00:27
at 2018-10-05T00:27
Musicha-原裝Ubuntu 的筆電

By Eartha
at 2018-10-04T00:28
at 2018-10-04T00:28
MPV開啟vaapi硬解播放DVD的ISO檔會有方格

By Quintina
at 2018-10-04T00:24
at 2018-10-04T00:24
apt-get 套件的問題

By Dora
at 2018-10-03T23:12
at 2018-10-03T23:12
GCP的ssh問題

By Olive
at 2018-10-03T20:30
at 2018-10-03T20:30