#include <stdio.h>
#include <stdlib.h>

int main()
{
	FILE *fp = popen("/sbin/fdisk -l | grep '/dev/' 2>/dev/null","r");
	char *s;
	char buf[100] = "";

	if (!fp)
		exit(1);

	do {
		s = fgets(buf, sizeof buf, fp);
		printf("%s", buf);
	} while (s);

	return EXIT_SUCCESS;
}
