bash - C use Linux shell functions -
i need make use of bash libraries, sort example , wanted know if can use in c program. instance have file.
(hola)
hola adios bye bye adieu aloha goodbye zap random word word random
when execute in terminal
$ sort hola > holaordenado $ cat holaordenado
prints...
adieu adios aloha bye bye goodbye hola random word word random zap
is there way can make exact command
$ sort hola > holaordenado
work inside c program?
#include <stdio.h> #include <stdlib.h> int main () { int i; printf ("executing command ...\n"); i=system ("sort hola > holaordenado"); printf ("the value returned was: %d.\n",i); return 0; }
Comments
Post a Comment