Mailinglist Archive: opensuse (1318 mails)

< Previous Next >
Re: [opensuse] BASH - while read; howto read last line in file without blank line at end?
  • From: Sandy Drobic <suse-linux-e@xxxxxxxxxxxxxxxxxxxxxxx>
  • Date: Sat, 01 Nov 2008 05:22:20 +0100
  • Message-id: <490BD97C.8070603@xxxxxxxxxxxxxxxxxxxxxxx>
David C. Rankin wrote:

I'm stumped on another simple BASH problem. How do I read the last line
of a
file with a while loop without requiring a blank line at the end of the file?
Simple example I'm stuck on:

{ while read alias url; do
echo -e "${alias}\t${url}"
done } < ~/linux/scripts/config/repos

Remove the curly brackets and everything runs fine on my system.


List replies only please!
Please address PMs to: news-reply2 (@) japantest (.) homelinux (.) com
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups