if (scriptpath[scriptpathlen-1]=='~') error("bad char end");
r= stat(scriptpath,&stab); if (r) syserror("stat script");
if (S_ISREG(stab.st_mode)) break;
if (scriptpath[scriptpathlen-1]=='~') error("bad char end");
r= stat(scriptpath,&stab); if (r) syserror("stat script");
if (S_ISREG(stab.st_mode)) break;