Shell script有幾種寫法 - Linux

By Erin
at 2014-07-29T15:14
at 2014-07-29T15:14
Table of Contents
最近遇到的詭異問題
照裡說script前端宣告了 #!/bin/bach 後
應該只有一種寫法吧?!
可是我發現我寫 if 條件判斷的時候...
完全不能使用一般資料上寫的 if[條件]; then
那樣子會syntax error
後來我摸了很久 才發現用 if expr (條件); then 可以
可是好像沒人介紹這種寫法啊 我是自己亂湊湊出來的
我用的版本是Fedora 14 / 16 ... 目前試起來都這樣
--
照裡說script前端宣告了 #!/bin/bach 後
應該只有一種寫法吧?!
可是我發現我寫 if 條件判斷的時候...
完全不能使用一般資料上寫的 if[條件]; then
那樣子會syntax error
後來我摸了很久 才發現用 if expr (條件); then 可以
可是好像沒人介紹這種寫法啊 我是自己亂湊湊出來的
我用的版本是Fedora 14 / 16 ... 目前試起來都這樣
--
Tags:
Linux
All Comments

By Eartha
at 2014-07-31T17:04
at 2014-07-31T17:04

By Regina
at 2014-08-02T02:17
at 2014-08-02T02:17

By Una
at 2014-08-06T19:43
at 2014-08-06T19:43

By Puput
at 2014-08-11T05:10
at 2014-08-11T05:10

By Susan
at 2014-08-14T15:41
at 2014-08-14T15:41

By Edwina
at 2014-08-19T04:41
at 2014-08-19T04:41

By Emily
at 2014-08-20T22:53
at 2014-08-20T22:53

By John
at 2014-08-25T08:13
at 2014-08-25T08:13

By Quintina
at 2014-08-26T15:17
at 2014-08-26T15:17

By Bethany
at 2014-08-29T17:23
at 2014-08-29T17:23

By Heather
at 2014-08-31T19:50
at 2014-08-31T19:50

By Quanna
at 2014-09-01T13:22
at 2014-09-01T13:22

By Irma
at 2014-09-05T07:21
at 2014-09-05T07:21
Related Posts
NIS設定完成後無法登入SSH

By Zora
at 2014-07-28T22:58
at 2014-07-28T22:58
repo 抓manifest失敗

By Frederic
at 2014-07-28T17:55
at 2014-07-28T17:55
iptables設定問題

By Sarah
at 2014-07-28T17:21
at 2014-07-28T17:21
iptables設定問題

By Yuri
at 2014-07-28T16:31
at 2014-07-28T16:31
請問開機CD

By Elvira
at 2014-07-28T12:40
at 2014-07-28T12:40