Hi,
I don't really get your first request. Do you mean what follows?
Code:
date +%T # time
date +%Z # time zone abbr.
date +%d.%m.%y # date
Homework?
As for the second,
sed(1) does easily do the job for simple cases:
Code:
sed -i.bak 's,//\(.*\)$,/*\1 */,' file.c
...but it's a pain for complex ones.
Use
uncrustify(1) to manage (almost) every case:
Code:
uncrustify -q -c <(echo cmt_cpp_to_c=1) --suffix=.tmp file.c && mv "$_"{.tmp,}
This turns, e.g.:
Code:
#include <stdlib.h>
// //
int main(void)
{
char const *const s = "//* foo // */*"; //
// /** */
(void)s; //* /*
return EXIT_SUCCESS; // / *b//a/ ** /r* / *//
}
...into:
Code:
#include <stdlib.h>
/* // */
int main(void)
{
char const *const s = "//* foo // */*"; /* */
/* / ** * / */
(void)s; /* * / * */
return EXIT_SUCCESS; /* / *b//a/ ** /r* / * // */
}