Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: easy way to read from stdin ?
- X-seq: zsh-users 1651
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: Sweth Chandramouli <sweth@xxxxxxxxxxxxxxxxxxxx>, ZSH Users <zsh-users@xxxxxxxxxxxxxxx>
- Subject: Re: easy way to read from stdin ?
- Date: Tue, 23 Jun 1998 16:50:03 -0700
- In-reply-to: <19980623184223.11524@xxxxxxxxxxxxxxxxxxxx>
- References: <19980623163758.05103@xxxxxxxxxxxxxxxxxxxx> <980623150145.ZM1264@xxxxxxxxxxxxxxxxxxxxxxx> <19980623184223.11524@xxxxxxxxxxxxxxxxxxxx>
On Jun 23, 6:42pm, Sweth Chandramouli wrote:
} Subject: Re: Re: easy way to read from stdin ?
}
} > What is it that you are doing to cause it to read from a file? That is,
} > when it's not a cgi, how do you run it?
} i put a "< filename" after the while read loop, so that it would
} read input from the file "filename". basically, i'm trying to create a
} mailto form here--it should take the values from the form in question,
} [...]
} but when i run it as a form, it acts as though it is getting no input.
Is the form using METHOD=post to send data to the server? Otherwise there
isn't any standard input. The enviroment variable CONTENT_LENGTH should
tell how many bytes you can expect to read.
Try doing
local input
read -u0k $CONTENT_LENGTH input
This should stuff the entire stdin (up to $CONTENT_LENGTH bytes) into
the variable "input". The input may be coming to you with "\r\n" line
endings, in which case I'm not sure how a plain "read" behaves.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author