Hi,
Could someone has any suggestions on this? When read a line from a file, I need to check the first char in the line, it could be a space or any char. But the leading spaces are removed by read.
Thanks.
Hi,
Could someone has any suggestions on this? When read a line from a file, I need to check the first char in the line, it could be a space or any char. But the leading spaces are removed by read.
Thanks.
See the following short example for one way of doing what you want.
#!/usr/bin/ksh93
TMP=file.$$
IFS=""
cat <<EOT >$TMP
AAA BBB CCC
DDD EEE FFF
EOT
while read LINE
do
echo $LINE
done < $TMP
rm $TMP
Thanks. Works by setting the IFS.