看板 EE_DSnP 關於我們 聯絡資訊
我照講議上打 alias G++ 'g++ -g -Wall -o \!*\!*.cpp' 得到 bash: alias: G++: not found bash: alias: g++ -g -Wall -o \!*\!*.cpp: not found 後來試改成 alias G++='g++ -g -Wall -o \!*\!*.cpp' 會ok 不過我打 G++ hw1.2.p1.cpp 會跑出 一個叫!*!*.cpp的執行檔@@ 若在 \!* \!*中間加空隔 g++: !*.cpp: No such file or directory hw1.2.p1.cpp: In function ‘int& f(int)’: hw1.2.p1.cpp:5: warning: reference to local variable ‘i’ returned 然後沒有執行檔跑出來 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.174.132 ※ 編輯: hoghcmkcm 來自: 140.112.174.132 (03/13 03:25)
timrau:Try alias G++='g++ -g -Wall -o $1 $1.cpp' 03/13 08:40
timrau:好像不行 似乎必須寫成bash script或function才行 03/13 08:50
ric2k1:那 alias G++="g++ -g -Wall -o $1 $1.cpp" 呢? 03/13 09:04
ric2k1:不行... 03/13 09:56