/*
 * Do basic padding the shell does not seem able to do
 * without great effort. It can probably be done, but then
 * writing this could be done faster. :-)
 *
 * Args: N-padd-chars string-to-pad
 *
 * 91-10-16 shawn@eddie.mit.edu
 */

#include <stdio.h>

/*
 * Main enter, syntax:
 *   padit xx string
 *
 * Which will cause padit to pad string to xx characters.
 */

main (argc, argv)
char *argv[];
{
	char fmt[40];

	/*
	 * Build fmt string for printf.
	 */

	sprintf (fmt, "%%-%d.%ds", atoi(argv[1]), atoi(argv[1]));

	/*	
	 * Let printf do the work :-)
	 */

	printf (fmt, argv[2]);
	
	exit (0);
}
