nfile
for (redir = n ; redir ; redir = redir->nfile.next) {
expandarg(redir->nfile.fname, &fn, EXP_TILDE);
redir->nfile.expfname = fn.args[0];
if (n->nfile.fd != deffd) {
s[0] = n->nfile.fd + '0';
cmdtxt(n->nfile.fname);
for (np = n->ncmd.redirect ; np ; np = np->nfile.next) {
np = (union node *)stalloc(sizeof (struct nfile));
np->nfile.fd = 1;
np->nfile.fd = 0;
if (sizeof (struct nfile) != sizeof (struct nhere)) {
np->nfile.fd = 0;
np->nfile.fd = digit_val(fd);
rpp = &n2->nfile.next;
rpp = &n2->nfile.next;
rpp = &n->nfile.next;
n->nfile.fname = makename();
calcsize(n->nfile.fname, result);
calcsize(n->nfile.next, result);
new->nfile.fname = copynode(n->nfile.fname, state);
new->nfile.next = copynode(n->nfile.next, state);
new->nfile.fd = n->nfile.fd;
ALIGN(sizeof (struct nfile)),
ALIGN(sizeof (struct nfile)),
ALIGN(sizeof (struct nfile)),
ALIGN(sizeof (struct nfile)),
ALIGN(sizeof (struct nfile)),
struct nfile nfile;
for (n = redir ; n ; n = n->nfile.next) {
fd = n->nfile.fd;
if ((n->nfile.type == NTOFD || n->nfile.type == NFROMFD) &&
int fd = redir->nfile.fd;
switch (redir->nfile.type) {
fname = redir->nfile.expfname;
fname = redir->nfile.expfname;
fname = redir->nfile.expfname;
fname = redir->nfile.expfname;
fname = redir->nfile.expfname;
for (np = cmd->ncmd.redirect ; np ; np = np->nfile.next) {
switch (np->nfile.type) {
if (np->nfile.fd != dftfd)
fprintf(fp, "%d", np->nfile.fd);
if (np->nfile.type == NTOFD || np->nfile.type == NFROMFD) {
} else if (np->nfile.type == NHERE) {
} else if (np->nfile.type == NXHERE) {
sharg(np->nfile.fname, fp);
print_verbage(const char *file, const char *nfile, off_t usize, off_t gsize)
if (nfile)
fprintf(stderr, " -- replaced with %s", nfile);
show(const char *nfile, const char *datafile, int copies)
if (strcmp(nfile, " ") == 0)
nfile = "(standard input)";
ldump(nfile, datafile, copies);
dump(nfile, datafile, copies);
dump(const char *nfile, const char *datafile, int copies)
nlen = strlen(nfile);
printf("...%s ", &nfile[3+nlen-rem]);
lastsep = strrchr(nfile, '/');
printf("%s", nfile);
ldump(const char *nfile, const char *datafile, int copies)
printf("%-2d copies of %-19s", copies, nfile);
printf("%-32s", nfile);
static int nfile(char *_n);
tfd = nfile(tfname);
fd = nfile(dfname);
struct file *nfile;
if ((nfile = pushfile($2, 0)) == NULL) {
file = nfile;
struct file *nfile;
if ((nfile = calloc(1, sizeof(struct file))) == NULL ||
(nfile->name = strdup(name)) == NULL) {
if (TAILQ_FIRST(&files) == NULL && strcmp(nfile->name, "-") == 0) {
nfile->stream = stdin;
free(nfile->name);
if ((nfile->name = strdup("stdin")) == NULL) {
free(nfile);
} else if ((nfile->stream = fopen(nfile->name, "r")) == NULL) {
warn("%s", nfile->name);
free(nfile->name);
free(nfile);
check_file_secrecy(fileno(nfile->stream), nfile->name)) {
fclose(nfile->stream);
free(nfile->name);
free(nfile);
nfile->lineno = 1;
TAILQ_INSERT_TAIL(&files, nfile, entry);
return (nfile);
int maxfile, nfile;
if (kinfo_get_openfiles(&nfile))
printf("%3d/%3d files\n", nfile, maxfile);