/* THE CODE BELOW CAUSES A RUN TIME ERROR */
system ("ifconfig eth1 \"$ETH1\" netmask 255.255.255.0");
==================================
root:~# ./test-small-network-sh-2
aaaaa
No address associated with name
ifconfig: `--help' gives usage information.
==================================
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*******************************************/
int main()
{
FILE *f, *panic_file, *fopen();
FILE *file_pointer;
file_pointer = popen("ifconfig eth0 up", "r");
file_pointer = popen("echo -e \"aaaaa\"", "w");
f = popen ("ETH0=DHCP", "r");
f = popen ("ETH1=10.0.1.1", "r");
f = popen ("NETMASK=", "r");
f = popen ("BROADCAST=", "r");
f = popen ("GATEWAY=127.0.0.1", "r");
f = popen ("source /etc/yellowbox/network-config", "r");
panic_file = fopen ("/proc/sys/kernel/panic", "w");
putc ('5', panic_file);
f = popen ("ifconfig lo 127.0.0.1", "r");
f = popen ("ifconfig eth0 up", "r");
/* THE CODE BELOW CAUSES A RUN TIME ERROR */
system ("ifconfig eth1 \"$ETH1\" netmask 255.255.255.0");
pclose (f);
pclose (file_pointer);
fclose (panic_file);
}