fi
#
# Initialize line counter variable
let LINE_COUNTER=$LINES
#
# Read the input file one line at a time and display on STDOUT until
# the page fills up. Display "Press <Enter>" message on STDERR and wait
# for keypress from STDERR. Continue until the end of the input file.
# Any input line greater than $COLUMNS characters in length is wrapped
# and counts as multiple lines.
#
while read −n $COLUMNS LINE_BUFFER; do
echo "$LINE_BUFFER"
let LINE_COUNTER=$LINE_COUNTER−1
if [ $LINE_COUNTER −le 1 ]; then
echo "Press <ENTER> for next page or <CTRL>+C to quit.">/dev/stderr
read</dev/stderr
let LINE_COUNTER=$LINES
fi
done<$INPUT
#
# end of more.sh
Create a symbolic link for
more
bash# ln −s more.sh ~/staging/bin/more
8.3.2. Create additional device files
bash# ln −s /proc/self/fd ~/staging/dev/fd
bash# ln −s fd/0 ~/staging/dev/stdin
bash# ln −s fd/1 ~/staging/dev/stdout
bash# ln −s fd/2 ~/staging/dev/stderr
bash# mknod −m644 ~/staging/dev/zero c 1 5
8.3.3. Install ps
Get the latest procps source package from http://procps.sourceforge.net/
bash# cd /usr/src/procps−3.2.3
bash# make SHARED=0 CC="gcc −mcpu=i386"
bash# cd ps
bash# cp ps ~/staging/bin
8.3.4. Install sed
Download GNU's sed from ftp://ftp.gnu.org/gnu/sed/
bash# cd /usr/src/sed−4.1.2
bash# export CC="gcc −mcpu=i386"
bash# ./configure −−host=i386−pc−linux−gnu
bash# make
bash# cd sed
bash# cp sed ~/staging/bin
Pocket Linux Guide
Chapter 8. Filling in the Gaps
44