以下備忘録
hatanoX> `basename $a .par`.dat
kwz_work> ${VAR%.par}.dat今まで `echo $hoge|sed -e 's/.par/.dat/'` してその場を済ませていたのは秘密だッ
結局こんなコードに
char *s, *d;
d = new char [strlen(argv[1])+4] ;
if ((s=strrchr(argv[1], '.')) == NULL)
s=strrchr(argv[1], '\0');
strncpy(d, argv[1], (size_t)(s-argv[1]));
strcat(d, ".dat");
一見動いてるけどにゃ〜
こらぼれーてど、うぃず #うにっくす:*.jp
相談に乗ってくれた人たち、どうもでした。
再度ちなむと、 .dat とか .par とか決め打ちになっているのは make で叩きまくる予定だから。
[referer:
The script did not produce proper HTTP headers. Please see the error log to see the detail of the errors. Depending on the server configuration, you can also run thisscript under CGIWrap debugging. Usually, either rename or linkthe script temporarily to a file which ends with .cgidextension, or add a AddHandler cgi-script-debug .cgiline to your .htaccess file.
]