#include <stdio.h>

main (int argc, char **argv)
{
    char fullname[128];
    static char buff[128];
    FILE *f;
    int len;
    char *val;

    if (argc < 2) exit(1);
    val = (argc < 3) ? "" : argv[2];

    sprintf(fullname, "ENV:%s", argv[1]);
    if (!(f = fopen(fullname, "w"))) return;
    len = fwrite(val, 1, strlen(val), f);
    fclose(f);
    exit(0);
}
