簡體   English   中英

如何在Cygwin中通過Shell腳本運行多個“指南針監視”?

[英]How to run multiple “compass watch” through shell script in Cygwin?

我想通過Cygwin中的shell腳本運行多個“指南針監視”命令。 看起來我已經完全忘記了shell腳本。 這是我嘗試過的:

#!/bin/bash
sitea="/cygdrive/c/xampp/htdocs/sitea/themes/siteatheme/css/"
siteb="/cygdrive/c/xampp/htdocs/siteb/themes/sitebtheme/css/"
sitec="/cygdrive/c/xampp/htdocs/sitec/themes/sitectheme/css/"
sited="/cygdrive/c/xampp/htdocs/sited/themes/sitedtheme/css/"
sitee="/cygdrive/c/xampp/htdocs/sitee/themes/siteetheme/css/"
sitef="/cygdrive/c/xampp/htdocs/sitef/themes/siteftheme/css/"

for i in sitea siteb sitec sited sitee sitef
  do
    compass watch "$i" &
  done

我收到以下錯誤消息重復6次:

$ C:\Installation\Ruby22-x64\bin\ruby.exe: No such file or directory -- /cygdrive/c/Installation/Ruby22-x64/bin/compass (LoadError)

看起來找不到compass命令,但是當我從bash終端輸入compass watch ,它運行正常。 我該如何解決?

通過將Windows樣式的路徑傳遞到羅盤並使用cygstart來解決此問題。 嘗試這樣的事情:

cygstart /cygdrive/c/Installation/Ruby22-x64/bin/compass watch $(cygpath -w $i)

cygstart會將控制權傳遞給Windows Shell。 cygpath -w將轉換為Windows路徑。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM