LDP/LDP/guide/docbook/abs-guide/redir5.sh

23 lines
364 B
Bash
Raw Normal View History

2001-07-10 14:25:50 +00:00
#!/bin/bash
if [ -z "$1" ]
then
2001-09-04 13:27:31 +00:00
Filename=names.data # Default, if no filename specified.
2001-07-10 14:25:50 +00:00
else
Filename=$1
fi
TRUE=1
2001-09-04 13:27:31 +00:00
if [ "$TRUE" ] # if true and if : also work.
2001-07-10 14:25:50 +00:00
then
read name
echo $name
fi <"$Filename"
2001-10-15 14:21:41 +00:00
# ^^^^^^^^^^^^
2001-07-10 14:25:50 +00:00
# Reads only first line of file.
2001-09-04 13:27:31 +00:00
# An "if/then" test has no way of iterating unless embedded in a loop.
2001-07-10 14:25:50 +00:00
exit 0