Lines Matching refs:arg
178 errormsg(SH_DICT,ERROR_usage(2), "%s",opt_info.arg);
253 register char *arg, *cp;
256 arg=nxtarg(tp,0);
257 if(arg && c_eq(arg, '!'))
259 if(c_eq(arg, '('))
270 if(c2_eq(arg,'-','t'))
284 if(*arg=='-' && arg[2]==0)
286 op = arg[1];
300 return(*arg!=0);
310 return(test_binop(tp->sh,op,arg,cp));
313 int test_unop(Shell_t *shp,register int op,register const char *arg)
320 return(permission(arg, R_OK));
322 return(permission(arg, W_OK));
324 return(permission(arg, X_OK));
329 if(stat(arg,&statb)<0 || !S_ISREG(statb.st_mode))
332 stakputs(arg);
335 arg = (const char*)stakptr(offset);
343 return(test_stat(arg,&statb)>=0 && S_ISDIR(statb.st_mode));
345 return(test_stat(arg,&statb)>=0 && S_ISCHR(statb.st_mode));
347 return(test_stat(arg,&statb)>=0 && S_ISBLK(statb.st_mode));
349 return(test_stat(arg,&statb)>=0 && S_ISREG(statb.st_mode));
351 return(test_mode(arg)&S_ISUID);
353 return(test_mode(arg)&S_ISGID);
356 return(test_mode(arg)&S_ISVTX);
365 if(*arg==0 || arg[strlen(arg)-1]=='/' || lstat(arg,&statb)<0)
371 return(test_stat(arg,&statb)>=0 && S_ISCTG(statb.st_mode));
379 if(test_stat(arg,&statb)>=0 && S_ISCDF(statb.st_mode))
381 stakputs(arg);
384 arg = (const char*)stakptr(offset);
386 return(test_stat(arg,&statb)>=0 && S_ISCDF(statb.st_mode));
393 return(isasock(arg,&statb));
395 return(test_stat(arg,&statb)>=0 && tmxgetmtime(&statb) > tmxgetatime(&statb));
397 return(isapipe(arg,&statb));
399 return(*arg != 0);
401 return(*arg == 0);
406 if(*arg==0 || test_stat(arg,&statb)<0)
415 if(memcmp(arg,"/dev/",5)==0 && sh_open(arg,O_NONBLOCK))
417 return(permission(arg, F_OK));
420 if(*arg=='?')
421 return(sh_lookopt(arg+1,&f)>0);
422 op = sh_lookopt(arg,&f);
427 op = strtol(arg,&last, 10);
436 if(!(np = nv_open(arg,shp->var_tree,NV_VARNAME|NV_NOFAIL|NV_NOADD|NV_NOREF)))