LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 09-24-2009, 03:03 PM   #1
beldings
LQ Newbie
 
Registered: Sep 2009
Posts: 1

Rep: Reputation: 0
how to fix this


while read LINE
do
echo $LINE
done < `tail -f /var/log/messages`
 
Old 09-24-2009, 03:29 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
This looks like homework----please tell us the context of the question---ie what are you trying to do?

AND: FIX WHAT???? You have not told us what is broken!!!!
 
Old 09-24-2009, 04:31 PM   #3
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
It doesn't seem like homework to me or he'd have been told not to use backticks.

I knew that either piping it through the front or using process substitution would work (forgot about here strings), but was having a hard time verbalizing why what he was doing was an 'ambiguous redirect' and found this, which says it pretty well:

http://linuxshellaccount.blogspot.co...output-to.html

If this is homework, sorry, but maybe you'll still learn something and the loop above surely can't be a very significant part of your homework.

Anyway, I don't know how new you are (welcome to LQ, btw), but three notes on the 'facepalm' level: you're going to have to have read permission to that file, of course, and you'll need to wait for it to get appended to to see any changes after the initial output and there's no way to exit except ^C. But I assumed you meant the redirection issue.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FIX---Fedora install hangs---To fix this---- jmckinzie Fedora - Installation 0 12-20-2005 12:08 AM
all attempts to fix the problem failed... can someone help me fix partition space? foreverdita Linux - Enterprise 2 05-11-2005 09:02 AM
reiserfsck --fix-fixable -> --fix-fixable ignored - why? BrianK Linux - Software 1 01-07-2005 08:45 PM
anyway to fix this..... Z28kid Linux - Newbie 5 03-12-2003 03:42 PM
How do i fix this? glitch Linux - Newbie 22 09-21-2002 08:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 06:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration