for迴圈變數被忽略 - Linux

By Noah
at 2017-12-23T12:26
at 2017-12-23T12:26
Table of Contents
各位大大好
最近踏入linux領域
在用指令執行程式時
覺得如果太多檔案會很麻煩
因此想製作一個sh檔
可以自行運作
原始檔案如下:
比如今天我有aaa15.node
aaa20.node
.
.
.
aaa170.node
單次執行時,指令為 circle aaa15.node...
我的sh檔案為:
#!/bin/bash
read -p i
read -p ii
for ((i;i<=ii;i=i+1));
do circle "aaa${i}.node";
done
結果在執行時,總是顯示
Error: Cannot access file aaa.node.
請問這是代表沒有讀到我的變數嗎?
試了很多種方法,仍然沒有解決
因此上來請教各位大大
麻煩各位大大幫小弟解惑
--
最近踏入linux領域
在用指令執行程式時
覺得如果太多檔案會很麻煩
因此想製作一個sh檔
可以自行運作
原始檔案如下:
比如今天我有aaa15.node
aaa20.node
.
.
.
aaa170.node
單次執行時,指令為 circle aaa15.node...
我的sh檔案為:
#!/bin/bash
read -p i
read -p ii
for ((i;i<=ii;i=i+1));
do circle "aaa${i}.node";
done
結果在執行時,總是顯示
Error: Cannot access file aaa.node.
請問這是代表沒有讀到我的變數嗎?
試了很多種方法,仍然沒有解決
因此上來請教各位大大
麻煩各位大大幫小弟解惑
--
Tags:
Linux
All Comments

By Daniel
at 2017-12-23T22:05
at 2017-12-23T22:05

By Harry
at 2017-12-28T21:05
at 2017-12-28T21:05

By Erin
at 2018-01-02T00:38
at 2018-01-02T00:38

By Megan
at 2018-01-03T11:52
at 2018-01-03T11:52

By Hedwig
at 2018-01-05T17:26
at 2018-01-05T17:26

By Franklin
at 2018-01-10T08:26
at 2018-01-10T08:26

By Zenobia
at 2018-01-10T23:19
at 2018-01-10T23:19

By Connor
at 2018-01-11T10:41
at 2018-01-11T10:41
Related Posts
Ubuntu PXE 開機後沒網路

By Joe
at 2017-12-22T10:08
at 2017-12-22T10:08
Ubuntu PXE 開機後沒網路

By Madame
at 2017-12-22T09:32
at 2017-12-22T09:32
cic更換license問題

By Erin
at 2017-12-20T16:36
at 2017-12-20T16:36
多nginx log檔案合併排序

By Margaret
at 2017-12-20T16:08
at 2017-12-20T16:08
Jetty https with wildcard

By Skylar DavisLinda
at 2017-12-20T09:30
at 2017-12-20T09:30