how review mutliline quarrel stdin non-static imitation out shell(sh,bash)?
what i wish following:
- read churned line quarrel
stdinnon-statica - make several operations
a - pipe
abut losing delimiter black (\n,\r,\t,etc) another command
the tide problem that, i can't review read command, since stops reading during newline.
i review stdin cat, this:
my_var=`cat /dev/stdin`
, nonetheless following i don't know imitation it. newline, tab, delimiters still there.
my illustration book looks this:
#!/usr/local/bin/bash
a=`cat /dev/stdin`
if [ ${#a} -eq 0 ]; then
exit 0
else
cat ${a} | /usr/local/sbin/nextcommand
fi
Comments
Post a Comment