我有這樣與函數原型文件:提取參數與腳本
int func1(type1 arg, int x);
type2 funct2(int z, char* buffer);
我想創建一個腳本(bash中,用sed,awk的,等等),將打印
function = func1 // first argument type = type1// second argument type = int
function = func1 // first argument type = int// second argument type = char*
換句話說,標記每行並打印函數名稱和參數。此外,我想將這些標記作爲變量在稍後打印出來,例如echo $4
。
我怎麼可以存儲在sed的索引嗎?例如 echo「abcd」| sed's/ab \(。* \)/ \ 1 /' 這會打印「cd」。我如何將cd存儲在變量中? – cateof 2010-07-27 09:45:48
'var = $(echo「abcd」| sed's/ab(。*)/ \ 1 /')' – ghostdog74 2010-07-27 09:51:35
幾乎在那裏。我有行「int func(struct type1 * tp,TYPE1 * name,TYPE2 * name2);」。我想存儲一個變量TYPE1和TYPE2並稍後打印它們 – cateof 2010-07-27 10:13:48