有關script的問題? - Linux

By Quanna
at 2008-11-15T12:26
at 2008-11-15T12:26
Table of Contents
各位版友好:
我寫了一個script如下
#!/bin/sh
for((i=1;i<=50;i++))
{
if[i<10] then
touch tty0$i;
else
touch tty$i;
fi;
}
這個script是要建立50個檔案
內容是tty01~tty50
這個script最後也會產生50個檔案,
但是會說此檔案不存在,
不過最主要的問題是
if~else的判斷似乎沒有用
它產生的檔案為tty1~tty50,
我寫的斷判式就沒有效果了!
請有經驗的版友給點意見吧!
--
我寫了一個script如下
#!/bin/sh
for((i=1;i<=50;i++))
{
if[i<10] then
touch tty0$i;
else
touch tty$i;
fi;
}
這個script是要建立50個檔案
內容是tty01~tty50
這個script最後也會產生50個檔案,
但是會說此檔案不存在,
不過最主要的問題是
if~else的判斷似乎沒有用
它產生的檔案為tty1~tty50,
我寫的斷判式就沒有效果了!
請有經驗的版友給點意見吧!
--
Tags:
Linux
All Comments
Related Posts
Re: Email被雅虎拒收똿

By Oliver
at 2008-11-15T09:11
at 2008-11-15T09:11
emacs的複製和貼上

By Skylar Davis
at 2008-11-15T00:03
at 2008-11-15T00:03
關於更改權限的問題?

By Agnes
at 2008-11-14T22:21
at 2008-11-14T22:21
Re: Email被雅虎拒收똿

By Selena
at 2008-11-14T22:19
at 2008-11-14T22:19
被 ubuntu 給耍了 :~(

By Eden
at 2008-11-14T22:06
at 2008-11-14T22:06