int g_dryrun;       // set to 1 if envvar DRYRUN was set in main()

void runP(int testValue, string cmd)
{
    if (g_dryrun)
        printf(cmd, "\n");
    else
        system(testValue, cmd);
}

void run(string cmd)
{
    runP(0, cmd);
}

void md(string target)
{
    int idx;
    list paths;

    paths = strtok(target, " ");

    for (idx = sizeof(paths); idx--; )
    {
        g_file = element(idx, paths);
        if (!exists(g_file))
            run("mkdir -p " + g_file);
    }
}

